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

Commit3f1ad82

Browse files
committed
DOC: Add note about locators at top of ticker docs
The note about not sharing `Locator` instances should be more prominentthan hiding in the base class docs, which most users have no need toexamine.
1 parent506b108 commit3f1ad82

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎lib/matplotlib/ticker.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@
8181
8282
The default minor locator is `NullLocator`, i.e., no minor ticks on by default.
8383
84+
.. note::
85+
`Locator` instances should not be used with more than one
86+
`~matplotlib.axis.Axis` or `~matplotlib.axes.Axes`. So instead of::
87+
88+
locator = matplotlib.ticker.MultipleLocator(5)
89+
ax.xaxis.set_major_locator(locator)
90+
ax2.xaxis.set_major_locator(locator)
91+
92+
do the following instead::
93+
94+
ax.xaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
95+
ax2.xaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
96+
8497
Tick formatting
8598
---------------
8699

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp