Skip to content

Tick locators cannot be reused... #19007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jklymak opened this issue Nov 25, 2020 · 1 comment
Closed

Tick locators cannot be reused... #19007

jklymak opened this issue Nov 25, 2020 · 1 comment

Comments

@jklymak
Copy link
Member

jklymak commented Nov 25, 2020

Bug report

Bug summary

Locators and Formatters stash info about what axis they are attached to and often use that info when they are called (via locator()). This makes locators (and some formatters) un-usable across multiple axes.

Code for reproduction

import matplotlib.pyplot as plt
import matplotlib as mpl
fig, ax = plt.subplots()
loc = mpl.ticker.AutoLocator()
ax.xaxis.set_major_locator(loc)
ax.yaxis.set_major_locator(loc)
ax.set_ylim([0.6, 0.8])
plt.show()

Actual outcome

Figure_1

Expected outcome

Probably the same outcome as

loc = mpl.ticker.AutoLocator()
ax.xaxis.set_major_locator(loc)
ax.yaxis.set_major_locator(mpl.ticker.AutoLocator())

FigureExpected

@jklymak
Copy link
Member Author

jklymak commented Nov 25, 2020

Actually a dupe of #13438 I'll add this to that....

@jklymak jklymak closed this as completed Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant