sliceview.py 文件源码

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

项目:segyviewer 作者: Statoil 项目源码 文件源码
def create_slice(self, context):
        """ :type context: dict """
        model = self._model
        axes = self._image.axes
        """ :type: matplotlib.axes.Axes """

        axes.set_title(model.title, fontsize=12)
        axes.tick_params(axis='both')
        axes.set_ylabel(model.y_axis_name, fontsize=9)
        axes.set_xlabel(model.x_axis_name, fontsize=9)

        axes.get_xaxis().set_major_formatter(FuncFormatter(model.x_axis_formatter))
        axes.get_xaxis().set_major_locator(AutoLocator())

        axes.get_yaxis().set_major_formatter(FuncFormatter(model.y_axis_formatter))
        axes.get_yaxis().set_major_locator(AutoLocator())

        for label in (axes.get_xticklabels() + axes.get_yticklabels()):
            label.set_fontsize(9)

        self._reset_zoom()

        axes.add_patch(self._vertical_indicator)
        axes.add_patch(self._horizontal_indicator)
        self._update_indicators(context)

        self._image.set_cmap(cmap=context['colormap'])

        self._view_limits = context["view_limits"][self._model.index_direction['name']]

        if model.data is not None:
            self._image.set_data(model.data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号