#!/usr/bin/python3 import matplotlib.pyplot as plt A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] x = [1, 2, 3] figure1 = plt.figure() plt.plot(x, A[0]) plt.plot(x, A[1]) plt.plot(x, A[2]) def onclick(event): if event.xdata == None: return col = int(event.xdata) if 0 <= col <= 2: Y = [A[i][col] for i in range(0, 3)] plt.figure() plt.plot(Y) plt.show() figure1.canvas.mpl_connect('button_press_event', onclick) plt.show()
How to create a new plot in a figure right below the first one after click event?
Messages In This Thread |
How to create a new plot in a figure right below the first one after click event? - by codexx - May-19-2019, 04:45 PM
RE: How to create a new plot in a figure right below the first one after click event? - by heiner55 - May-26-2019, 12:52 PM
|
Users browsing this thread: 1 Guest(s)