mpl.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:smhr 作者: andycasey 项目源码 文件源码
def _interactive_zoom_press(self, event):
        """
        Right-mouse button pressed in axis.

        :param event:
            A matplotlib event.
        """

        if event.button != 3 or event.inaxes is None:
            return None

        self._interactive_zoom_initial_bounds = [event.xdata, event.ydata]
        self._interactive_zoom_axis_index = self.figure.axes.index(event.inaxes)

        # Create lines if needed
        if self._interactive_zoom_axis_index not in self._right_click_zoom_box:
            self._right_click_zoom_box[self._interactive_zoom_axis_index] \
                = event.inaxes.plot([np.nan], [np.nan], "k:")[0]

        # Create zoom box signal
        self._interactive_zoom_box_signal = (
            time.time(),
            self.mpl_connect("motion_notify_event", self._update_interactive_zoom)
        )
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号