本文整理汇总了Python中matplotlib.rcsetup.validate_axisbelow方法的典型用法代码示例。如果您正苦于以下问题:Python rcsetup.validate_axisbelow方法的具体用法?Python rcsetup.validate_axisbelow怎么用?Python rcsetup.validate_axisbelow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.rcsetup
的用法示例。
在下文中一共展示了rcsetup.validate_axisbelow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_axisbelow
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_axisbelow [as 别名]
def set_axisbelow(self, b):
"""
Set the zorder for the axes ticks and gridlines.
Parameters
----------
b : bool or 'line'
``True`` corresponds to a zorder of 0.5, ``False`` to a zorder of
2.5, and ``"line"`` to a zorder of 1.5.
"""
self._axisbelow = axisbelow = validate_axisbelow(b)
if axisbelow is True:
zorder = 0.5
elif axisbelow is False:
zorder = 2.5
elif axisbelow == "line":
zorder = 1.5
else:
raise ValueError("Unexpected axisbelow value")
for axis in self._get_axis_list():
axis.set_zorder(zorder)
self.stale = True
示例2: set_axisbelow
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_axisbelow [as 别名]
def set_axisbelow(self, b):
"""
Set whether axis ticks and gridlines are above or below most artists.
This controls the zorder of the ticks and gridlines. For more
information on the zorder see :doc:`/gallery/misc/zorder_demo`.
Parameters
----------
b : bool or 'line'
Possible values:
- *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
- 'line' (zorder = 1.5): Ticks and gridlines are above patches
(e.g. rectangles, with default zorder = 1) but still below lines
and markers (with their default zorder = 2).
- *False* (zorder = 2.5): Ticks and gridlines are above patches
and lines / markers.
See Also
--------
get_axisbelow
"""
self._axisbelow = axisbelow = validate_axisbelow(b)
if axisbelow is True:
zorder = 0.5
elif axisbelow is False:
zorder = 2.5
elif axisbelow == "line":
zorder = 1.5
else:
raise ValueError("Unexpected axisbelow value")
for axis in self._get_axis_list():
axis.set_zorder(zorder)
self.stale = True
示例3: set_axisbelow
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_axisbelow [as 别名]
def set_axisbelow(self, b):
"""
Set whether axis ticks and gridlines are above or below most artists.
This controls the zorder of the ticks and gridlines. For more
information on the zorder see :doc:`/gallery/misc/zorder_demo`.
Parameters
----------
b : bool or 'line'
Possible values:
- *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
- 'line' (zorder = 1.5): Ticks and gridlines are above patches (
e.g. rectangles) but still below lines / markers.
- *False* (zorder = 2.5): Ticks and gridlines are above patches
and lines / markers.
See Also
--------
get_axisbelow
"""
self._axisbelow = axisbelow = validate_axisbelow(b)
if axisbelow is True:
zorder = 0.5
elif axisbelow is False:
zorder = 2.5
elif axisbelow == "line":
zorder = 1.5
else:
raise ValueError("Unexpected axisbelow value")
for axis in self._get_axis_list():
axis.set_zorder(zorder)
self.stale = True
示例4: set_axisbelow
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_axisbelow [as 别名]
def set_axisbelow(self, b):
"""
Set whether axis ticks and gridlines are above or below most artists.
.. ACCEPTS: [ bool | 'line' ]
Parameters
----------
b : bool or 'line'
"""
self._axisbelow = validate_axisbelow(b)
self.stale = True