Matplotlib でグラフプログラミング【Python】at TECH
Matplotlib でグラフプログラミング【Python】 - 暇つぶし2ch223:デフォルトの名無しさん
16/10/11 00:20:24.10 7970w8cq.net
>>222 追加
聞いてばかりですみません、もう一つ聞きたいことがありまして
ボタンを2つにした場合には
fig.canvas.mpl_connectをどうつなげるべきなのでしょうか?
class Index1(object):
def __init__(self, ax):
self.ax = ax
def next(self, event):
xdata = event.xdata
ydata = event.ydata
self.ax.plot(xdata, ydata, color="red", marker="o")
plt.draw()
def prev(self, event):
xdata = event.xdata
ydata = event.ydata
self.ax.plot(xdata, ydata, color="blue", marker="o")
plt.draw()

axnext = plt.axes([0.81, 0.05, 0.1, 0.075])
axprev = plt.axes([0.11, 0.05, 0.1, 0.075])
fig.canvas.mpl_connect('button_press_event', Index(ax).???)
bnext = Button(axnext, 'red')
bnext.on_clicked(Index(ax).next)
bnext = Button(axprev, 'blue')
bnext.on_clicked(Index(ax).prev)


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch