Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Locators: First visible tick does not havepos=0 #2509

Closed
@megies

Description

@megies

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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp