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
wx backend assertion error with fig.canvas.timer.start() #18620
wx assertion error when starting canvas timer instance.
Code for reproduction
import matplotlib
matplotlib.use('WXAgg')
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
def update_title(axes):
axes.set_title(datetime.now())
axes.figure.canvas.draw()
fig, ax = plt.subplots()
x = np.linspace(-3, 3)
ax.plot(x, x ** 2)
timer = fig.canvas.new_timer(interval=100)
timer.add_callback(update_title, ax)
timer.start()
plt.show()
Actual outcome
Traceback (most recent call last):
File "timer_debug.py", line 18, in <module>
timer = fig.canvas.new_timer(interval=100)
File "/Users/ewthornton/opt/anaconda3/envs/grid_gen3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2374, in new_timer
return self._timer_cls(interval=interval, callbacks=callbacks)
File "/Users/ewthornton/opt/anaconda3/envs/grid_gen3/lib/python3.7/site-packages/matplotlib/backends/backend_wx.py", line 78, in __init__
TimerBase.__init__(self, *args, **kwargs)
File "/Users/ewthornton/opt/anaconda3/envs/grid_gen3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1094, in __init__
self.single_shot = False
File "/Users/ewthornton/opt/anaconda3/envs/grid_gen3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1145, in single_shot
self._timer_set_single_shot()
File "/Users/ewthornton/opt/anaconda3/envs/grid_gen3/lib/python3.7/site-packages/matplotlib/backends/backend_wx.py", line 91, in _timer_set_single_shot
self._timer.Start()
wx._core.wxAssertionError: C++ assertion "m_milli > 0" failed at /opt/concourse/worker/volumes/live/3ef8f33f-8e5b-442f-6716-948fc4646a36/volume/wxpython_1547931203930/work/ext/wxWidgets/src/osx/core/timer.cpp(69) in Start(): invalid value for timer timeout
Activity
QuLogic commentedon Oct 1, 2020
Can you see if #18621 fixes it?
gonesurfing commentedon Oct 2, 2020
This appears to have fixed it.