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
Zooming to a point changes a picked point's index for data longer than 100 points #3124
Comments
This is likely do to optimizations that drop points that we can't see, but I can see why this is a major problem for UIs. @joferkington Have you seen this working on mpldatacursor? |
The number 100 comes from the threshold for using subslices when zooming. The In summary, I don't see any bug here in mpl. |
On Sat, Jun 7, 2014 at 5:52 PM, Eric Firing notifications@github.com
Che
|
Sorry, I didn't read your code carefully enough. The soultion is actually much simpler, Picking actually fires off a |
In the matplotlib examples directory, see event_handling/pick_event_demo.py. |
If you have a list longer than 100 data points, and zoom to the final point and click on it (while using point picking), the index number of that point will be reset to a much lower number, depending on how tightly you zoom.
In the example below, using 155 data points from my data, the data starts out truncated to the first 101 data points. Run the program (tested; works with Python 2.7 and Matplotlib 1.3.1) and click the last data point. What will be printed in the shell is, "index is: [100]". Now zoom into that point very tightly, and click on it again. Now what will be printed is, "index is: [1]".
You can change the truncation_number near the end of the program and if you set it to be 100 or less, this error will not occur.
Small runnable sample code follows:
TAC - edited to add code-markup
The text was updated successfully, but these errors were encountered: