Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5154cba

Browse files
committed
Fix mathtext_wx example not redrawing plots
1 parent fef412e commit 5154cba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/user_interfaces/mathtext_wx.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ def __init__(self, parent, title):
4343

4444
self.figure = Figure()
4545
self.axes = self.figure.add_subplot(111)
46-
self.change_plot(0)
4746

4847
self.canvas = FigureCanvas(self, -1, self.figure)
4948

49+
self.change_plot(0)
50+
5051
self.sizer = wx.BoxSizer(wx.VERTICAL)
5152
self.add_buttonbar()
5253
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
@@ -106,7 +107,7 @@ def change_plot(self, plot_number):
106107
s = functions[plot_number][1](t)
107108
self.axes.clear()
108109
self.axes.plot(t, s)
109-
self.Refresh()
110+
self.canvas.draw()
110111

111112

112113
class MyApp(wx.App):

0 commit comments

Comments
 (0)