|
From: Paul I. <piv...@gm...> - 2011-01-13 04:34:08
|
Christopher Fonnesbeck, on 2011-01-12 20:12, wrote: > I'm wondering if there is a way of automating tick labeling on > log-scale axes, so that labels do not overlap. Specifically, > when the values get large, they overlap which makes the labels > unreadable. I would expect them to automatically get more > sparse with the axis value, as they do when you generate such > plots in R, for example. Hi Christopher, can you provide a small code example that demonstrates the problem you're having? The ticks get placed by a ticklocator. You can change the number of ticks that get placed by setting the appropriate locators numticks parameter. In [50]: plt.loglog(1,1) Out[50]: [<matplotlib.lines.Line2D object at 0x108dde4c>] In [51]: ax = plt.gca() In [52]: loc = ax.xaxis.get_major_locator() In [53]: loc.numticks Out[53]: 15 In [54]: loc.numticks = 10 IIRC, the variable name changes slightly from locator to locator, but you can quickly figure it out in ipython using tab completion in IPython once you grab a given locator object. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |