I just want to set ["10%","20%"....] on colorbar. However, failed again and again. Thank you for your help.
The following code work properly. But when I set formatter = FixedFormatter(["10%","20%","30%","40%"]) No labels is shown on colorbar, Why? Is there any way to set the char "%" on colorbar? from matplotlib.ticker import MultipleLocator, FixedFormatter,FormatStrFormatter from pylab import * import matplotlib.colors as colors delta = 0.025 x = y = arange(-3.0, 3.0, delta) X, Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10 * (Z2-Z1) im = imshow(Z, interpolation='bilinear', norm = colors.Normalize(vmin = -1.0, vmax = 1.0, clip = False), origin='lower', extent=[-3,3,-3,3]) locator=MultipleLocator(0.4) #formatter = FixedFormatter(["10%","20%","30%","40%"]) formatter=FormatStrFormatter("%0.1f") colorbar(im, extend='both', shrink=0.8,format=formatter,ticks=locator) show() -- View this message in context: http://www.nabble.com/formatter-on-colorbar-----tp16656691p16656691.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users