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


Python Axes.contourf方法代码示例

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


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

示例1: contourf

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import contourf [as 别名]
    def contourf(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.contourf` 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.contourf(workspace) #for workspaces
            ax.contourf(x,y,z)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.contourf`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')
            workspace = args[0]
            return self.track_workspace_artist(workspace,
                                               plotfunctions.contourf(self, *args, **kwargs))
        else:
            return Axes.contourf(self, *args, **kwargs)
开发者ID:mantidproject,项目名称:mantid,代码行数:28,代码来源:__init__.py

示例2: contourf

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import contourf [as 别名]
    def contourf(self, X, Y, Z, *args, **kwargs):
        '''
        Create a 3D contourf plot.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as numpy.arrays
        *Z*
        *zdir*      The direction to use: x, y or z (default)
        *offset*    If specified plot a projection of the filled contour
                    on this position in plane normal to zdir
        ==========  ================================================

        The positional and keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.contourf`

        Returns a :class:`~matplotlib.axes.Axes.contourf`
        '''

        zdir = kwargs.pop('zdir', 'z')
        offset = kwargs.pop('offset', None)

        had_data = self.has_data()

        jX, jY, jZ = art3d.rotate_axes(X, Y, Z, zdir)
        cset = Axes.contourf(self, jX, jY, jZ, *args, **kwargs)
        self.add_contourf_set(cset, zdir, offset)

        self.auto_scale_xyz(X, Y, Z, had_data)
        return cset
开发者ID:CTPUG,项目名称:matplotlib,代码行数:33,代码来源:axes3d.py

示例3: contourf

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import contourf [as 别名]
 def contourf(self, X, Y, Z, *args, **kwargs):
     '''
     Plot filled 3D contours.
     *X*, *Y*, *Z*: data points.
     Keyword arguments are passed on to
     :func:`~matplotlib.axes.Axes.contour`
     '''
     had_data = self.has_data()
     cset = Axes.contourf(self, X, Y, Z, *args, **kwargs)
     levels = cset.levels
     colls = cset.collections
     for z1, z2, linec in zip(levels, levels[1:], colls):
         art3d.poly_collection_2d_to_3d(linec, z1)
         linec.set_sort_zpos(z1)
     self.auto_scale_xyz(X, Y, Z, had_data)
     return cset
开发者ID:,项目名称:,代码行数:18,代码来源:


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