本文整理汇总了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)
示例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
示例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