From: Ryan K. <rya...@gm...> - 2006-04-13 18:25:05
|
The new formatter works pretty well. One change though, the last line should be: else: return LogFormatterMathtext.__call__(self, x, pos) Thanks, John On 4/13/06, John Hunter <jdh...@ac...> wrote: > >>>>> "Ryan" =3D=3D Ryan Krauss <rya...@gm...> writes: > > Ryan> My love of large fonts is causing a problem. If you look at > Ryan> the attached figure, I typically have x and y tick marks > Ryan> that nearly collide in the lower left hand corner of each > Ryan> subplot. I typically end up setting the yticks by hand, but > Ryan> this isn't super convienent for each plot. I am about to > Ryan> right a function to drop the lowest ytick label, but is > Ryan> there a better approach? > > Increase the xtick.major.pad and/or ytick.major.pad rc settings by a > couple of points. > > Alternatively, if you do want to drop the leftmost xtick label, for > instance, you can easily derive a custom formatter. Here you are using > the LogFormatterMathtext > > from matplotlib.ticker import LogFormatterMathtext > > class MyFormatter(LogFormatterMathtext): > def __call__(self, x, pos=3DNone): > if pos=3D=3D0: return '' # pos=3D0 is the first tick > else: return LogFormatterMathtext(self, x, pos) > > ax.xaxis.set_major_formatter(MyFormatter()) > > Nice looking figure! > JDH > |