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

draggable not working #113

Open
walidbou6 opened this issue Mar 8, 2022 · 1 comment
Open

draggable not working #113

walidbou6 opened this issue Mar 8, 2022 · 1 comment

Comments

@walidbou6
Copy link

first, thank you for the great job you did, (I was trying for about 2 days to make this stuff, great job) anyway I have tested the following code:

import matplotlib.pyplot as plt
import numpy as np
from mpldatacursor import datacursor
data = np.outer(range(10), range(1, 5))
fig, ax = plt.subplots()
ax.set_title('Try dragging the annotation boxes')
ax.plot(data)
datacursor(display='multiple', draggable=True)
plt.show()

but the draggable function didn't work for me, any idea why?

OS: Windows 10
Python: 3.8.5
Matplotlib: 3.3.2

@gituser789
Copy link

Basic Usage exampe also not working.
Are there any hints?

Basic Usage Example

import matplotlib.pyplot as plt
import numpy as np
from mpldatacursor import datacursor

data = np.outer(range(10), range(1, 5))

fig, ax = plt.subplots()
lines = ax.plot(data)
ax.set_title('Click somewhere on a line')

datacursor(lines)

plt.show()

Error Message

Traceback (most recent call last):
  File "...../python3.10/site-packages/matplotlib/cbook/__init__.py", line 287, in process
    func(*args, **kwargs)
  File "...../python3.10/site-packages/mpldatacursor/datacursor.py", line 704, in _select
    fixed_event = event_axes_data(event, anno.axes)
  File "...../python3.10/site-packages/mpldatacursor/datacursor.py", line 687, in event_axes_data
    x, y = ax.transData.inverted().transform_point(point)
AttributeError: 'NoneType' object has no attribute 'transData'

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

2 participants