|
From: Tommy C. <tom...@gm...> - 2015-02-14 19:40:04
|
Thanks Eric. I decided to get peace of mind and just set the tick labels manually. I can't afford to spend several hours on all of my plots. I appreciate your help a lot. On Sat, Feb 14, 2015 at 7:37 PM, Eric Firing <ef...@ha...> wrote: > On 2015/02/14 9:15 AM, Tommy Carstensen wrote: >> >> Eric, it works if I do: >> return MultipleLocator.tick_values(self, vmin, vmax)[2:] >> >> But not if I do as first suggested by you: >> return MultipleLocator.tick_values(self, vmin, vmax)[1:] >> > > Are you using my test script but getting a different result? If not, what > is the difference in your test script? > >> I don't understand this behaviour. It should be [1:]. I'll just set >> the ticks manually. Seems to be the easiest thing. It would be >> awesome, if MPL had the same behaviour as gnuplot, which allows me to >> simply do: >> set xtics <start>, <incr> > > > def xtics(ax, start, incr): > stop = ax.dataLim.x1 + 0.01 * incr > ax.xaxis.set_ticks(np.arange(start, stop, incr)) > > > Now invoke that function *after* all your plot calls, so that the dataLim > bounding box includes all the data in your plot. > > Eric |