当前位置: 首页>>代码示例>>Python>>正文


Python Axes.imshow方法代码示例

本文整理汇总了Python中matplotlib.axes.Axes.imshow方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.imshow方法的具体用法?Python Axes.imshow怎么用?Python Axes.imshow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.axes.Axes的用法示例。


在下文中一共展示了Axes.imshow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: imshow

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import imshow [as 别名]
    def imshow(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
        or it can be used to plot :class:`mantid.api.MatrixWorkspace`
        or :class:`mantid.api.IMDHistoWorkspace`. You can have something like::

            import matplotlib.pyplot as plt
            from mantid import plots

            ...

            fig, ax = plt.subplots(subplot_kw={'projection':'mantid'})
            ax.imshow(workspace) #for workspaces
            ax.imshow(C)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.imshow`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')

            def _update_data(artists, workspace):
                return self._redraw_colorplot(plotfunctions.imshow,
                                              artists, workspace, **kwargs)
            workspace = args[0]
            return self.track_workspace_artist(workspace,
                                               plotfunctions.imshow(self, *args, **kwargs),
                                               _update_data)
        else:
            return Axes.imshow(self, *args, **kwargs)
开发者ID:mantidproject,项目名称:mantid,代码行数:33,代码来源:__init__.py

示例2: display_image

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import imshow [as 别名]
 def display_image(self):
 
     # plot and save the image
     img = self.compute_image()
     
     # clear previous figure
     self.fig.clf()
     # setup plot 
     ax = Axes(self.fig, [0, 0, 1, 1]) # remove outer border  
     ax.set_axis_off()                 # disable axis
     ax.set_xlim((self.xmin, self.xmax))
     ax.set_ylim((self.ymin, self.ymax))
     ax.set_xticklabels([])
     ax.set_yticklabels([])
     ax.imshow(img, cmap=pl.get_cmap(self.cmap), interpolation='nearest', 
               extent=[self.xmin, self.xmax, self.ymin, self.ymax],
               origin='upper', aspect=1.0)
               
     self.fig.add_axes(ax)
开发者ID:TarasKuzyo,项目名称:python-fractals,代码行数:21,代码来源:julia-fractal.py

示例3: imshow

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import imshow [as 别名]
    def imshow(self, *args, **kwargs):
        '''
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
        or it can be used to plot :class:`mantid.api.MatrixWorkspace`
        or :class:`mantid.api.IMDHistoWorkspace`. You can have something like::

            import matplotlib.pyplot as plt
            from mantid import plots

            ...

            fig, ax = plt.subplots(subplot_kw={'projection':'mantid'})
            ax.imshow(workspace) #for workspaces
            ax.imshow(C)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`mantid.plots.plotfunctions.imshow`
        '''
        if mantid.plots.helperfunctions.validate_args(*args):
            mantid.kernel.logger.debug('using mantid.plots.plotfunctions')
            return mantid.plots.plotfunctions.imshow(self, *args, **kwargs)
        else:
            return Axes.imshow(self, *args, **kwargs)
开发者ID:samueljackson92,项目名称:mantid,代码行数:26,代码来源:__init__.py


注:本文中的matplotlib.axes.Axes.imshow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。