Skip to content
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

Issues zooming in and out with shared axis #5270

Closed
cimarronm opened this issue Oct 18, 2015 · 7 comments
Closed

Issues zooming in and out with shared axis #5270

cimarronm opened this issue Oct 18, 2015 · 7 comments
Assignees
Milestone

Comments

@cimarronm
Copy link
Contributor

I'm noticing a problem when zooming in on plots with shared axis and number of points >1000. If I zoom in on a plot and then try going back ('r' or 'h' key), the plots seem to have much of the data masked out.

Minimum working example
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(nrows=2, ncols=1, sharex=True)

size = 10000
ax[0].plot(np.random.random(size))
ax[1].plot(np.arange(size))

plt.show()
@QuLogic
Copy link
Member

QuLogic commented Oct 19, 2015

I don't think the shared axis is even necessary; simply this will trigger it:

import matplotlib.pyplot as plt
import numpy as np
plt.plot(np.random.random(10000))
plt.show()

@mdboom
Copy link
Member

mdboom commented Oct 19, 2015

Wow. That's pretty serious. I'm going to look into it.

@mdboom mdboom added this to the next point release (1.5.0) milestone Oct 19, 2015
@mdboom mdboom self-assigned this Oct 19, 2015
@mdboom
Copy link
Member

mdboom commented Oct 19, 2015

First bad commit is: 3c2c037

mdboom added a commit to mdboom/matplotlib that referenced this issue Oct 19, 2015
Before, the subsliced line will only be made if it's sufficiently
smaller than before.  However, when zooming out after zooming in,
it may actually be *larger* than before.  Rather than tracking which is
occurring, it's best to just always remake -- it doesn't seem to be an
important optimization anyway.
@mdboom
Copy link
Member

mdboom commented Oct 19, 2015

Would you mind trying #5275 for a fix?

@cimarronm
Copy link
Contributor Author

@mdboom, #5275 does fix it for me. 👍 Thanks for looking into it; I didn't have time yesterday but wanted to make sure I put the issue up.

@mdboom
Copy link
Member

mdboom commented Oct 19, 2015

No problem -- it's always better to know about the problem, and thankfully the fix for this should make it into 1.5.0!

mdboom added a commit that referenced this issue Oct 19, 2015
Always remake the subsliced line.  Fix #5270
@QuLogic
Copy link
Member

QuLogic commented Oct 19, 2015

#5275 was merged.

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

3 participants