I am confused about what is happening when I add a color bar to an image
using discrete colors. I took the example code for poormans_contour.py
and added a color bar to it.
The color bar show 9, not 10, equal sized pieces. I figured that the
10th color could be just a strip on top which was never used in the
plot. Therefor I set the limits of the plot to -0.1 and 0.1 to ensure
that parts of the image were below the minimum and parts were above the
maximum. Now I can clearly see 10 colors on the plot, but only 9 on the
color bar. Was this the intention? Is there another method of putting
a color bar on a contour plot of this type?
This is how I modified poormans_contour.py:
After the call to imshow in line 34, I added
clim(vmin = -0.1, vmax = 0.1)
colorbar()
--
Ms. Carol A. Leger
SRI International Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: le...@sr...
|