0

how to I get the label text in the middle of one area/color of the colorbar like in the image bellow?

my code is like this:

cbar = plt.colorbar()
cbar.ax.invert_yaxis()
cbar.ax.set_yticklabels(['A', 'B', 'C'])
gustavgans
  • 5,141
  • 13
  • 41
  • 51
  • possible duplicate of [Defining a discrete colormap for imshow in matplotlib](http://stackoverflow.com/questions/9707676/defining-a-discrete-colormap-for-imshow-in-matplotlib) – Ffisegydd Dec 04 '14 at 12:53
  • 2
    the answer in [this](http://stackoverflow.com/questions/10466730/add-separate-colors-for-two-or-more-specific-values-in-color-plot-and-color-ba) question does exactly what you want – Ajean Dec 04 '14 at 22:10

0 Answers0