colors = ['darkgreen', 'darkred', 'red', 'green', 'lightgray']to_plot = np.swapaxes(all_channel_maps, 0, 1)# to_plot = all_channel_mapsplt.pcolormesh(to_plot, edgecolors='k', linewidth=0.1, cmap=ListedColormap(colors))ax = plt.gca()# ax.invert_yaxis()ax.set_aspect('equal')print(ax.pcolor)plt.show()
all_channel_maps
is a 2D array of integers ranging from 0 to 4, each mapped to a specific color.
I want the cells with dark colors (values 0 and 1 in all_channel_maps
) to be hatched in the resulting image.
How can I do this?