DAVID HORNER wrote: > Hi all, > > I'm having problems with axis labels for large integers (1471674 is > represented as 1000 +1.479e6) .... I really need to see the number as > a conventional integer. I have the feeling that it should be possible > with ticker. FormatStrFormatter but I have not been able to work out > how. Any advice would be greatly appreciated. > Assuming 'ax' is your current set of axes (obtained from gca() or a call to subplot(), for example)... from matplotlib import ticker ...
ax.xaxis.set_major_formatter(ticker.FormatStrFormatter("%d")) ax.yaxis.set_major_formatter(ticker.FormatStrFormatter("%d")) > While I'm asking stupid questions, I'd also like to know how to let > the absolute dimensions of a subplot (with a barh() horizontal bar > chart) adjust themselves according to the number of bars added > (keeping the height of the bars strictly constant rather than the bar > height adjusting according to the number of data points). > There's no direct way to do this, but by setting the figure size based on the number of bars, you should be able to fake it. You can set the overall figure size either when you create the figure: figure(figsize=(4,3)) or after the fact (which doesn't really work with interactive GUIs -- that is, it won't resize the window) -- gcf().set_size_inches((4, 3)) The unit is in inches -- the dpi of the figure can also be set in a similar way. Hope that at least helps, Mike > Many thanks > > David > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users