I have two arrays which I am plotting on a separate grid of nodes using colors. One represents some clusters and the other some other values I'll refer to as my features. Example code:
import numpy as np
import matplotlib.pyplot as plt
clusters = np.array([[0,2,1], [0,3,1], [3,3,1]]) # make cluster data
features= np.array([[0,0.4,0.7], [0.1,0.3,0.7], [0.5,0.4,0.8]]) # make data of features
# plot clusters
plt.figure()
plt.pcolor(clusters, cmap='jet') # color in nodes
plt.colorbar(ticks=[i for i in range(0, np.amax(clusters)+1)]) # make colorbar legend per cluster
plt.show()
# plot feature grid
plt.figure()
plt.pcolor(features, cmap='bone', vmin=0, vmax=1) # color in nodes
plt.colorbar() # make colorbar legend
plt.show()
In this second grey coloured grid with my feature data I would like to display the border between my clusters by means of gridlines. The expected result would look something like this, where the red line indicates the borders between the clusters:
Is there any way to automatically draw these gridlines using the data of the cluster array? Any help would be appreciated!