本文整理汇总了Python中matplotlib.axes.Axes.tricontour方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.tricontour方法的具体用法?Python Axes.tricontour怎么用?Python Axes.tricontour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.tricontour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tricontour
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import tricontour [as 别名]
def tricontour(self, X, Y, Z, *args, **kwargs):
'''
Create a 3D contour plot.
========== ================================================
Argument Description
========== ================================================
*X*, *Y*, Data values as numpy.arrays
*Z*
*extend3d* Whether to extend contour in 3D (default: False)
*stride* Stride (step size) for extending contour
*zdir* The direction to use: x, y or z (default)
*offset* If specified plot a projection of the contour
lines on this position in plane normal to zdir
========== ================================================
Other keyword arguments are passed on to
:func:`~matplotlib.axes.Axes.tricontour`
Returns a :class:`~matplotlib.axes.Axes.contour`
'''
extend3d = kwargs.pop('extend3d', False)
stride = kwargs.pop('stride', 5)
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.tricontour(self, jX, jY, jZ, *args, **kwargs)
self.add_contour_set(cset, extend3d, stride, zdir, offset)
self.auto_scale_xyz(X, Y, Z, had_data)
return cset
示例2: tricontour
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import tricontour [as 别名]
def tricontour(self, *args, **kwargs):
"""
If the **mantid** projection is chosen, it can be
used the same as :py:meth:`matplotlib.axes.Axes.tricontour` 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.tricontour(workspace) #for workspaces
ax.tricontour(x,y,z) #for arrays
fig.show()
For keywords related to workspaces, see :func:`plotfunctions.tricontour`
"""
if helperfunctions.validate_args(*args):
logger.debug('using plotfunctions')
workspace = args[0]
return self.track_workspace_artist(workspace,
plotfunctions.tricontour(self, *args, **kwargs))
else:
return Axes.tricontour(self, *args, **kwargs)