- 225 名前:デフォルトの名無しさん [2016/10/09(日) 23:30:59.35 ID:xxl1bgNt.net]
- matplotlibで簡単なGUIのアプリケーションを自作しようと考えています
そこでボタンを押したときにキャンバスの中央に点がでるようなGUIを作成しようとしているのですが from numpy.random import rand import matplotlib.pyplot as plt from matplotlib.widgets import Button fig = plt.figure() ax = fig.add_subplot(111) plt.subplots_adjust(bottom=0.2) class Index(object): def next(self, event): xdata = event.xdata ydata = event.ydata plt.plot(0,0,color="red",marker="o") plt.draw() axnext = plt.axes([0.81, 0.05, 0.1, 0.075]) bnext = Button(axnext, 'circle') bnext.on_clicked(Index().next) plt.show() サイトを参考に以上のように組んではいるのですが ボタンを押した際ボタンの方の中央にプロットされてしまいます これをキャンバスの方の中央にプロットするにはどのようにしたらよいでしょうか? 欲を言えばボタンを押した後に中央のキャンバス上でクリックした場所に赤い点を出したいです
|

|