-
Notifications
You must be signed in to change notification settings - Fork 47
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
mpldatacursor doesn't work when matplotlib plot embedded in tkinter canvas #100
Comments
@Yulia444 - For the case where you're constructing the figure and embedding in a lower-level widget, Therefore, you should explicitly pass in the artists that you'd like The first argument to |
I launched the second example, clicked on the point and then the error occured: Exception in Tkinter callback |
That's a change in matplotlib with version 3.3.0. There's a fix in master,
but there hasn't been a release of mpldatacursor with that fix yet, as that
version of matplotlib just came out. You'll need to update from master
(e.g. `pip install git+https://github.com/joferkington/mpldatacursor`).
…On Mon, Sep 28, 2020 at 2:54 AM Yulia444 ***@***.***> wrote:
I launched the second example, clicked on the point and then the error
occured:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\tkinter_
*init*_.py", line 1883, in *call*
return self.func(*args)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\matplotlib\backends_backend_tk.py", line 293, in
button_press_event
FigureCanvasBase.button_press_event(
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\matplotlib\backend_bases.py", line 1854, in
button_press_event
self.callbacks.process(s, mouseevent)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\matplotlib\cbook_*init*_.py", line 229, in
process
self.exception_handler(exc)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\matplotlib\cbook_*init*_.py", line 81, in
*exception_printer raise exc File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\matplotlib\cbook_init*.py", line 224, in process
func(*args, **kwargs)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 718, in _select
self(new_event)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 235, in
*call*
self._show_annotation_box(event)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 275, in
_show_annotation_box
self.update(event, annotation)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 575, in update
annotation.set_text(self.formatter(**info))
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 348, in
_formatter
x = self._format_coord(x, ax.xaxis)
File "C:\Users\User\Desktop\Новая папка
(2)\env\lib\site-packages\mpldatacursor\datacursor.py", line 413, in
_format_coord
return formatter.pprint_val(x)
AttributeError: 'ScalarFormatter' object has no attribute 'pprint_val'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG5MMYGAJKG33ON3O5KWNDSIA6NBANCNFSM4R3SLWPA>
.
|
Here is my code
the hint
the hint is supposed to be shown after clicking on any blue dot on the plot, even though when I used without tkinter library it worked perfectly
The text was updated successfully, but these errors were encountered: