本文整理汇总了Python中matplotlib.colors._sanitize_extrema方法的典型用法代码示例。如果您正苦于以下问题:Python colors._sanitize_extrema方法的具体用法?Python colors._sanitize_extrema怎么用?Python colors._sanitize_extrema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.colors
的用法示例。
在下文中一共展示了colors._sanitize_extrema方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_clim
# 需要导入模块: from matplotlib import colors [as 别名]
# 或者: from matplotlib.colors import _sanitize_extrema [as 别名]
def set_clim(self, vmin=None, vmax=None):
"""
set the norm limits for image scaling; if *vmin* is a length2
sequence, interpret it as ``(vmin, vmax)`` which is used to
support setp
ACCEPTS: a length 2 sequence of floats; may be overridden in methods
that have ``vmin`` and ``vmax`` kwargs.
"""
if vmax is None:
try:
vmin, vmax = vmin
except (TypeError, ValueError):
pass
if vmin is not None:
self.norm.vmin = colors._sanitize_extrema(vmin)
if vmax is not None:
self.norm.vmax = colors._sanitize_extrema(vmax)
self.changed()