python类RadioButtons()的实例源码

graphs.py 文件源码 项目:PetroPy 作者: toddheitmann 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def _radio_click(self, label):
        """
        Event handler for selecting which editing type to use.
        Connected on line 763 with on_click method for RadioButtons
        object.
        """
        if label == 'No Edit':
            if self._edit_curve is not None:
                self._edit_curve.set_bbox({'facecolor':'white',
                                           'edgecolor': 'white',
                                           'alpha': 0})
        elif label == 'Manual Edit':
            if self._edit_curve is not None:
                self._edit_curve.set_bbox({'facecolor':'khaki',
                                           'edgecolor': 'khaki',
                                           'alpha': 1})
        elif label == 'Bulk Shift':
            if self._edit_curve is not None:
                self._edit_curve.set_bbox({'facecolor':'khaki',
                                           'edgecolor': 'khaki',
                                           'alpha': 1})

        self.fig.canvas.draw()
analyze.py 文件源码 项目:quantdigger 作者: andyzsf 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def __init__(self, fname, n=10, intraday=False):
        """ """
        self.fig = plt.figure(facecolor='white')
        self.fig.canvas.set_window_title(u'??')
        self.nbar = n
        self.cursors = []
        self.data, = load_datas(n, intraday, fname)
        print self.data
        self.axes = []
        self.rax = plt.axes([0, 0.5, 0.08, 0.15])
        self.radio = RadioButtons(self.rax, ('scatter', 'summary', 'summary2', 'entry', 'exit', 'simple'), active=0)
        self.axes, self.cursors = scatter_analyze(self.fig, self.data)
        self.radio.on_clicked(self.update)


问题


面经


文章

微信
公众号

扫码关注公众号