本文整理匯總了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