On Fri, Aug 21, 2009 at 10:01 AM, Scott Sinclair<scott.sinclair...@gmail.com> wrote: >> I just realized that I did not give the correct plot object when creating >> the colorbar. Now it works perfectly to pass arguments by set_xticklabels(). >> >> However, another question just arose. To format the numbers on the tick >> labels I tried to pass a format string when creating the colorbar with the >> format parameter. But it has no effect. The same when I give a >> FormatStrFormatter object. I also tried to use >> cb.ax.axis.set_major_formatter(). The effect of this was. That it sets the >> labels to the range between 0 and 1. Is there a solution for this problem >> besides entering the tick labels manually?
The tick locator and tick formatter needs to be passed during the colorbar creation. Otherwise, it gets very tricky to deal with. This is because the data coordinate of the colorbar axes is not directly associated with the ticklabels. If passing the formatter during the colorbar creation has no effect, this should be filed as a bug. Please post a small standalone example that reproduces your problem. Also, please report your version of matplotlib. If you're using older version, I recommend you to test it with newer version. Just in case, my quick test worked fine. imshow([[1,2],[2,3]]) cb=colorbar(format=r"$%2.1f\%%$") -JJ ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users