Is it possible to change the colors of the colorbar plot to grayscale ? At the moment I plot them like this:
ax = fig.add_subplot(326,title='Title')
cax = ax.matshow(newcm)
fig.colorbar(cax)
ax.set_xticklabels(['']+alpha)
ax.set_yticklabels(['']+alpha)
pl.show()
Though off course they appear in color. But is it possible to change them to grayscale ? And how ?
The colorbar shows the colormap used for the data. If you want different colors, specify a different colormap in your matshow call:
ax.matshow(newcm, cmap=pyplot.cm.Greys)
You can see available colormaps at http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps . There a couple grayscale options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With