On Fri, Oct 22, 2010 at 1:47 AM, Dmitry Vinokurov <df6....@gmail.com> wrote: > Hello, > > When I plot graph with values 10^5 and more at y axis, the labels are > too long and run out of the picture borders. So I get "600000" instead > of "1600000" at y axis or something like this. Tried to use > ==== > majorFormatter = ticker.FormatStrFormatter('%e') > ax.yaxis.set_major_formatter(majorFormatter) > ==== > but it became even worse -- "00e+00", "00e+05", "00e+06", i.e. first > digits run out of picture border or I see only part of digit. > > Is it possible to make matplotlib automatically change picture size due > to it's content? Or maybe there is some other way to solve my problem? > > Thanks.
Simply you can log scale your axes for such big ranges. Other alternative would be shifting your subplot to left using figure subplots_adjust function. Both Wx and Qt4 backends provide graphical access to this function on navigation toolbar, so you can first experiment to make the visual fit your need (If you use WX backend actually you can see the numeric values to use in subplots_adjust function). You can also follow this thread: http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html to make fancier adjustments to tick labels. -- Gökhan ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users