線を表示 (および同じボタンで非表示) できるものを作成したいと考えています。
これが私が今のところ持っているものです:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
fig, ax = plt.subplots()
class Index(object):
ind = 0
def test(self, event):
self.plt.plot([0, 0], [1, 1])
plt.draw()
callback = Index()
axtest = plt.axes([0.81, 0.05, 0.1, 0.075])
btest = Button(axtest, 'Test')
btest.on_clicked(callback.test)
plt.show()
誰かがこのスクリプトで私を助けることができますか? これを行う方法が本当にわかりません。