multiple lines in 1 graph

Hi, i have a matplotlib graph and i want to insert several lines or linesets
to the graph. Until here no problem. I also want to see curser lines by
adding onMouseMove-Event through 'motion_modify_event'-declaration. My
problem is, that only the first drawn line is visible after mmoving the
mouse on the graph. When the graph is only loaded, everything is visible,
but by moving the mouse the second plot will be invisible.I dont know, whats
the problem. THis is my code.def PlotInput(self): self.fig = Figure
(figsize=(5,4), dpi=100) self.canvas = FigureCanvasTkAgg(self.fig,self) = self.fig.add_subplot(111) = self.fig.add_subplot(111)
#fuer 2d-Plot'Definition der LRUGL')'Breite y [mm]')'H?he z [mm]')[-2000,2000,0, 5000]) self.toolbar
= NavigationToolbar2TkAgg(self.canvas,self) self.toolbar.update()
self.plot_widget = self.canvas.get_tk_widget()
self.plot_widget.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
self.toolbar.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) def onMouseMove(event):
= [[0]] if event.xdata and event.ydata: # python3 often
has None, color="k"), color="k")
self.canvas.mpl_connect('motion_notify_event', onMouseMove) def fig_ax_request(x, y, x2):
ya = np.array(x) za = np.array(y) yb = np.array(x2),za, color='red', linestyle='--', marker='')
self.fig.canvas.draw(),za, color='red',
linestyle='--', marker='') self.fig.canvas.draw()
subscribe('UPDATE_LRUGL_GRAPH', 'DRAW_INFO') subscribe('DRAW_INFO',
fig_ax_request) subscribe('LRUGL_FIRST_DRAW', 'DRAW_FIRST')
subscribe('DRAW_FIRST', fig_ax_request)The subscribes get lists to fill the
graph. The first expression updates the graph when data already exists in a
gui table. The second expression fills the graph by loading a file. So the
parameters "x","y","x2" are lists.


View this message in context:
Sent from the matplotlib - users mailing list archive at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>