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

Added a Parameter interpolate_pickpos #19

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sapus
Copy link
Contributor

@sapus sapus commented Feb 18, 2014

I wannted to have a simple way to look at original plotted data without any interpolation. I think this is a "should have" for a data cursor.

line_props is now line_props_interpolated as it interpolates values between original values. The simple way to get original plot values is now line_props
added a parameter to select if the pick info in 2D plots is interpolated or not.
python 3 support
python 3 support
python 3 support
Get nearest click point with line_props
interpolate_pickpos standard is false not true
@jondo
Copy link

jondo commented Apr 21, 2015

@joferkington, could you please have a look at this? Can this be un-bitrotted and merged? Or should the "python 3 support" commits be removed?

@joferkington
Copy link
Owner

@jondo - The python3 related commits were merged in a separate pull request by @sapus well before this pull request (e.g. c0e1950 )

Note that there were a couple of lingering unicode differences with python3 that I missed up until #25 (i.e. the git HEAD has these fixes but the current release version doesn't).

I've left this pull request open as a reminder to myself to implement an option not to follow the line of a Line2D. However, it can't quite be implemented as it is here, and implementing in general (for all artists) is considerably harder.

In the meantime, here's a workaround if you want to snap to only verticies of a Line2D and not the line itself (note that you can also accomplish this through the props_override kwarg, similar to the bar example, but it's easier to use two artists in this case).

import matplotlib.pyplot as plt
import mpldatacursor

x, y = range(10), range(10)

fig, ax = plt.subplots()
line, = ax.plot(x, y, 'b-')
points, = ax.plot(x, y, 'bo')

mpldatacursor.datacursor(points)
plt.show()

@jondo
Copy link

jondo commented Apr 21, 2015

@joferkington - I understand. Nice workaround, I'll try that!

@lzj-r
Copy link

lzj-r commented Apr 18, 2020

how to capture the max value aroud the cursor , just like interactive annotation in matlab . how to use props_override, i am confused, thank you .

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

Successfully merging this pull request may close these issues.

4 participants