Problem 1: I have a dataset which has more values on one side of the scale
than the other in a contour map. Matplotlib will see that I have more values
towards one side of the scale, and put all of the colors in that color map
to that side of the scale.
For example, lets say I would like my colorbar to show values from -10^6 all
the way to 10^6.
But, most of my values are in the -10^6 to -10^5 range. How do I get my
colorbar not to automatically send all of the colors to that portion of the
colorbar and leave everything greater than -10^5 to have one color.
I would like to have the colorbar displaying the same color scaling
regardless of the data input.
Here is a copy of my code:
cset4 = plt.contourf(x2,z2,k2,v2,cmap=cm.get_cmap('jet', len(v2)-1))
cset5 = plt.contour(x2,z2,k2,v2,colors = 'k',linewidths = .22,hold='on')
#set axes values
#set y axes label
plt.title('v3 Plot Max:'+str("%.2f" %k2.max())+' Min:
cbar = plt.colorbar(cset4,spacing="uniform", shrink =
Problem 2: If I have a colorbar scale which goes from -10 to 5, and I use
one of the standard colormaps which has white in the center of it. How do I
keep the zero point at the white color instead of the colorbar automatically
picking the midpoint for zero?
Problem 1 is much more of a pressing issue right now than problem 2.
View this message in context: http://old.nabble.com/Disable-Colorbar-Scaling-In-Contour-Plot-tp29409978p29409978.html
Sent from the matplotlib - users mailing list archive at Nabble.com.