From: Carol Leger <carol.leger@sr...> - 2005-01-12 20:04:32
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)
Ms. Carol A. Leger
SRI International Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: leger@...
From: John Hunter <jdhunter@ac...> - 2005-01-15 22:38:13
>>>>> "Carol" == Carol Leger <carol.leger@...> writes:
Carol> This is how I modified poormans_contour.py:
It's a bug; in the matplotlib/pylab.py function "colorbar", replace
the line that reads
N = 200
N = cmap.N
No need to tweak the clim....
Should cure what ails ya,
Get latest updates about Open Source Projects, Conferences and News.