Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
I noticed that various Locators have problems designatingpos=0
to the first visible tick. While this might not be very important for most people, I still thought I'd mention it here.
ForAutoDateLocator
this happens below a certain threshold of x range. Below an x range of around 5e-5 (equal to approximately 5 seconds) the tick with position 0 is not inside the plot anymore.
I admit that this is a rather low value for date plots and thus might be considered very low priority.
ForAutoLocator
this seems to be a general problem. Almost always the first visible tick has position 1.
The following script demonstrates both cases. Zoom in/out on x axes and look atpos
of the first tick.
importmatplotlib.pyplotaspltfrommatplotlib.tickerimportFuncFormatterfromnumpy.randomimportrandndefprint_pos(x,pos=None):return"%s: %s"% (str(pos),str(x))fig=plt.figure(figsize=(16,6))fig.suptitle("xticklabels are 'pos: x'")ax=fig.add_subplot(211)left=10right=left+6e-5ax.plot_date([left,right], [1,1])ax.xaxis.set_major_formatter(FuncFormatter(print_pos))ax.set_title("zoom in: leftmost tick has position 1")ax=fig.add_subplot(212)ax.plot(randn(20),randn(20))ax.xaxis.set_major_formatter(FuncFormatter(print_pos))ax.set_title("zoom in/out: leftmost tick has position 1")plt.show()