You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
invalid command name "..._on_timer" in FuncAnimation for (too) small interval #8107
To get a high frame rate for my animation I use a low value for 'interval' for 'FuncAnimation'. If interval is too low p.ex. 10, I get the following Exception, when (and only when) I close the window:
invalid command name "140613997300232_on_timer"
while executing
"140613997300232_on_timer"
("after" script)
Traceback (most recent call last):
File "./monitor.py", line 93, in
plt.show()
File "env/lib/python3.5/site-packages/matplotlib/pyplot.py", line 253, in show
return _show(*args, **kw)
File "env/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 163, in call
manager.show()
File "env/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py", line 610, in show
self.canvas.manager.window.attributes('-topmost', 1)
AttributeError: 'NoneType' object has no attribute 'attributes'
Looks like a race condition tearing down the window (because you closed it) and the timer being fired (only shows up at low interval because you have at catch a timer 'in flight' when you click the 'close' button).
The ultimate cause of this bug was the destruction of the tk canvas occurring before the execution of _on_timer in the Tcl event queue while simultaneously failing to execute after_cancel (can't really explain that). The bug appears to be fixed on master, likely by #17802 or #17789. This issue should be closed if others can reproduce this, however, a new bug has appeared for the smallest values of interval, see #18236.
Hi, I got the same error. I am trying to plot real-time values in Tkinter which I obtained from Arduino sensor data. The plots work and everything is working but I get this error shown below. My sensor values contain floating-point values.
Can someone tell me should I fix this issue or just leave it as everything is working fine?
Forex like this
[2.05
1.74
1.65
1.6
1.59
1.59
1.6
1.59
1.58
1.58
1.6]
My error is
invalid command name "1873019790016_on_timer"
while executing
"1873019790016_on_timer"
("after" script)
invalid command name "1873007000832_on_timer"
while executing
"1873007000832_on_timer"
("after" script)
Activity
voxspox commentedon Feb 20, 2017
https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/1666230
dstansby commentedon Feb 20, 2017
Thanks for the bug report! Could you possibly post a minimal example of code (including all the module imports) that triggers this error?
tacaswell commentedon Feb 20, 2017
Looks like a race condition tearing down the window (because you closed it) and the timer being fired (only shows up at low interval because you have at catch a timer 'in flight' when you click the 'close' button).
anntzer commentedon Feb 20, 2017
I can reproduce with
examples/animation/simple_anim.pywith an interval set to 1 and the tkagg backend.As a side note that example doesn't work at all in the gtk3agg backend:
QuLogic commentedon Feb 21, 2017
@anntzer You need
cairocffifor Gtk3Agg + Python 3 to work; you should have got a warning about it.anntzer commentedon Feb 21, 2017
Ah, yes, I didn't see the warning because it got immediately drowned out by the repeating (due to animation) error message regarding
create_for_data.If it doesn't work without cairocffi, should it be an ImportError?
Robomate commentedon Feb 4, 2018
happens, when I close the matplotlib animation plot.
richardsheridan commentedon Aug 12, 2020
The ultimate cause of this bug was the destruction of the tk canvas occurring before the execution of
_on_timerin the Tcl event queue while simultaneously failing to executeafter_cancel(can't really explain that). The bug appears to be fixed on master, likely by #17802 or #17789. This issue should be closed if others can reproduce this, however, a new bug has appeared for the smallest values of interval, see #18236.ffernandoalves commentedon Oct 31, 2020
I get the same error when the blit parameter is True, for a large volume of data
aravindpoolla07 commentedon Mar 10, 2022
Hi, I got the same error. I am trying to plot real-time values in Tkinter which I obtained from Arduino sensor data. The plots work and everything is working but I get this error shown below. My sensor values contain floating-point values.
Can someone tell me should I fix this issue or just leave it as everything is working fine?
Forex like this
[2.05
1.74
1.65
1.6
1.59
1.59
1.6
1.59
1.58
1.58
1.6]
My error is
invalid command name "1873019790016_on_timer"
while executing
"1873019790016_on_timer"
("after" script)
invalid command name "1873007000832_on_timer"
while executing
"1873007000832_on_timer"
("after" script)
My code looks like this
Function to append values into the plot
tacaswell commentedon Mar 10, 2022
@aravindpoolla07 Can you please open a new issue?
aravindpoolla07 commentedon Mar 10, 2022
ok sure.