ম্যাটপ্লটলিব Button
🌈ম্যাটপ্লটলিব Button কি?
📋ম্যাটপ্লটলিব Button হলো বোতাম তৈরি করার পদ্ধতি।
⚒️ম্যাটপ্লটলিব Button বোতাম তৈরি করতে ব্যবহৃত হয়।
ম্যাটপ্লটলিব Button বোতাম তৈরি করার উদাহরণ।
matplotlib
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()