সম্পাদনা
import matplotlib.pyplot as plt from matplotlib.widgets import Button figure, axes = plt.subplots() line, = axes.plot( [1, 2, 3], [2, 4, 6] ) button_axes = figure.add_axes( [0.8, 0.05, 0.1, 0.05] ) button = Button( button_axes, "Change" ) def change(event): line.set_ydata( [6, 4, 2] ) figure.canvas.draw_idle() button.on_clicked(change) plt.show()
পূর্বরূপ