File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
galleries/examples/user_interfaces Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,15 @@ def __init__(self):
46
46
self ._dynamic_ax = dynamic_canvas .figure .subplots ()
47
47
# Set up a Line2D.
48
48
self .xdata = np .linspace (0 , 10 , 101 )
49
- self ._update_data ()
49
+ self ._update_ydata ()
50
50
self ._line , = self ._dynamic_ax .plot (self .xdata , self .ydata )
51
51
# The below two timers must be attributes of self, so that the garbage
52
52
# collector won't clean them after we finish with __init__...
53
53
54
54
# The data retrieval may be fast as possible (Using QRunnable could be
55
55
# even faster).
56
56
self .data_timer = dynamic_canvas .new_timer (1 )
57
- self .data_timer .add_callback (self ._update_data )
57
+ self .data_timer .add_callback (self ._update_ydata )
58
58
self .data_timer .start ()
59
59
# Drawing at 50Hz should be fast enough for the GUI to feel smooth, and
60
60
# not too fast for the GUI to be overloaded with events that need to be
@@ -63,7 +63,7 @@ def __init__(self):
63
63
self .drawing_timer .add_callback (self ._update_canvas )
64
64
self .drawing_timer .start ()
65
65
66
- def _update_data (self ):
66
+ def _update_ydata (self ):
67
67
# Shift the sinusoid as a function of time.
68
68
self .ydata = np .sin (self .xdata + time .time ())
69
69
You can’t perform that action at this time.
0 commit comments