本文整理汇总了Python中matplotlib.lines.Line2D.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Line2D.__init__方法的具体用法?Python Line2D.__init__怎么用?Python Line2D.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.lines.Line2D
的用法示例。
在下文中一共展示了Line2D.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.lines import Line2D [as 别名]
# 或者: from matplotlib.lines.Line2D import __init__ [as 别名]
def __init__(self, ticksize, tick_out=False, **kwargs):
self._ticksize = ticksize
self.locs_angles_labels = []
self.set_tick_out(tick_out)
self._axis = kwargs.pop("axis", None)
if self._axis is not None:
if "color" not in kwargs:
kwargs["color"] = "auto"
if ("mew" not in kwargs) and ("markeredgewidth" not in kwargs):
kwargs["markeredgewidth"] = "auto"
Line2D.__init__(self, [0.], [0.], **kwargs)
AttributeCopier.__init__(self, self._axis, klass=Line2D)
self.set_snap(True)
示例2: __init__
# 需要导入模块: from matplotlib.lines import Line2D [as 别名]
# 或者: from matplotlib.lines.Line2D import __init__ [as 别名]
def __init__(self, ticksize, tick_out=False, *, axis=None, **kwargs):
self._ticksize = ticksize
self.locs_angles_labels = []
self.set_tick_out(tick_out)
self._axis = axis
if self._axis is not None:
if "color" not in kwargs:
kwargs["color"] = "auto"
if "mew" not in kwargs and "markeredgewidth" not in kwargs:
kwargs["markeredgewidth"] = "auto"
Line2D.__init__(self, [0.], [0.], **kwargs)
AttributeCopier.__init__(self, self._axis, klass=Line2D)
self.set_snap(True)
示例3: __init__
# 需要导入模块: from matplotlib.lines import Line2D [as 别名]
# 或者: from matplotlib.lines.Line2D import __init__ [as 别名]
def __init__(self, target: Artist):
self.target = target
self.figure = target.figure
self.do_scale = True
self.fixed_aspect = False
# a patch uses the data_transform
if isinstance(self.target, mpl.patches.Patch):
self.get_transform = self.target.get_data_transform
# axes use the figure_transform
elif isinstance(self.target, Axes):
# and optionally have a fixed aspect ratio
if self.target.get_aspect() != "auto" and self.target.get_adjustable() != "datalim":
self.fixed_aspect = True
self.get_transform = lambda: self.target.figure.transFigure
# texts use get_transform
elif isinstance(self.target, Text):
if getattr(self.target, "xy", None) is not None:
self.do_scale = True
else:
self.do_scale = False
if checkXLabel(self.target):
self.label_factor = self.figure.dpi / 72.0
if getattr(self.target, "pad_offset", None) is None:
self.target.pad_offset = self.target.get_position()[1] - checkXLabel(
self.target).xaxis.labelpad * self.label_factor
self.label_y = self.target.get_position()[1]
elif checkYLabel(self.target):
self.label_factor = self.figure.dpi / 72.0
if getattr(self.target, "pad_offset", None) is None:
self.target.pad_offset = self.target.get_position()[0] - checkYLabel(
self.target).yaxis.labelpad * self.label_factor
self.label_x = self.target.get_position()[0]
self.get_transform = self.target.get_transform
# the default is to use get_transform
else:
self.get_transform = self.target.get_transform
self.do_scale = False