Hi - I'm having problems - I don't get any line displayed on my screen. My code looks as follows (Init):
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self.Panel, -1, self.figure)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.Panel.SetSizer(self.sizer)
Some event will occur and do the following (it does):
self.axes.add_line(Line2D([],[])
As soon this event arrives, I'll receive data:
def receive(self, data, source):
line = self.data[source][0] # Retreive the line
xdata = line.get_xdata()
ydata = line.get_ydata()
for x in data:
xdata.append(x[2]) # The data I've received
ydata.append(x[0])
self.data[source][0].set_data(xdata, ydata) # Set the data
self.canvas.draw()
self.canvas.gui_repaint()
I do receive data, I see that I have lines in self.axes, but I never achieved to have a line on my display. What am I missing?
Thanks
Benjamin Schindler