本文整理汇总了Python中transforms.TransformedPath.get_transformed_points_and_affine方法的典型用法代码示例。如果您正苦于以下问题:Python TransformedPath.get_transformed_points_and_affine方法的具体用法?Python TransformedPath.get_transformed_points_and_affine怎么用?Python TransformedPath.get_transformed_points_and_affine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transforms.TransformedPath
的用法示例。
在下文中一共展示了TransformedPath.get_transformed_points_and_affine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Line2D
# 需要导入模块: from transforms import TransformedPath [as 别名]
# 或者: from transforms.TransformedPath import get_transformed_points_and_affine [as 别名]
#.........这里部分代码省略.........
if self.is_dashed():
cap = self._dashcapstyle
join = self._dashjoinstyle
else:
cap = self._solidcapstyle
join = self._solidjoinstyle
gc.set_joinstyle(join)
gc.set_capstyle(cap)
gc.set_snap(self.get_snap())
funcname = self._lineStyles.get(self._linestyle, '_draw_nothing')
if funcname != '_draw_nothing':
tpath, affine = self._transformed_path.get_transformed_path_and_affine()
if len(tpath.vertices):
self._lineFunc = getattr(self, funcname)
funcname = self.drawStyles.get(self._drawstyle, '_draw_lines')
drawFunc = getattr(self, funcname)
drawFunc(renderer, gc, tpath, affine.frozen())
if self._marker:
gc = renderer.new_gc()
self._set_gc_clip(gc)
rgbFace = self._get_rgb_face()
rgbFaceAlt = self._get_rgb_face(alt=True)
edgecolor = self.get_markeredgecolor()
if is_string_like(edgecolor) and edgecolor.lower() == 'none':
gc.set_linewidth(0)
gc.set_foreground(rgbFace)
else:
gc.set_foreground(edgecolor)
gc.set_linewidth(self._markeredgewidth)
gc.set_alpha(self._alpha)
marker = self._marker
tpath, affine = self._transformed_path.get_transformed_points_and_affine()
if len(tpath.vertices):
# subsample the markers if markevery is not None
markevery = self.get_markevery()
if markevery is not None:
if iterable(markevery):
startind, stride = markevery
else:
startind, stride = 0, markevery
if tpath.codes is not None:
codes = tpath.codes[startind::stride]
else:
codes = None
vertices = tpath.vertices[startind::stride]
subsampled = Path(vertices, codes)
else:
subsampled = tpath
snap = marker.get_snap_threshold()
if type(snap) == float:
snap = renderer.points_to_pixels(self._markersize) >= snap
gc.set_snap(snap)
gc.set_joinstyle(marker.get_joinstyle())
gc.set_capstyle(marker.get_capstyle())
marker_path = marker.get_path()
marker_trans = marker.get_transform()
w = renderer.points_to_pixels(self._markersize)
if marker.get_marker() != ',':
# Don't scale for pixels, and don't stroke them
marker_trans = marker_trans.scale(w)
else:
gc.set_linewidth(0)
renderer.draw_markers(
示例2: Line2D
# 需要导入模块: from transforms import TransformedPath [as 别名]
# 或者: from transforms.TransformedPath import get_transformed_points_and_affine [as 别名]
#.........这里部分代码省略.........
if not self._visible:
return
gc = renderer.new_gc()
self._set_gc_clip(gc)
gc.set_foreground(self._color)
gc.set_antialiased(self._antialiased)
gc.set_linewidth(self._linewidth)
gc.set_alpha(self._alpha)
if self.is_dashed():
cap = self._dashcapstyle
join = self._dashjoinstyle
else:
cap = self._solidcapstyle
join = self._solidjoinstyle
gc.set_joinstyle(join)
gc.set_capstyle(cap)
funcname = self._lineStyles.get(self._linestyle, "_draw_nothing")
if funcname != "_draw_nothing":
tpath, affine = self._transformed_path.get_transformed_path_and_affine()
lineFunc = getattr(self, funcname)
lineFunc(renderer, gc, tpath, affine.frozen())
if self._marker is not None:
gc = renderer.new_gc()
self._set_gc_clip(gc)
gc.set_foreground(self.get_markeredgecolor())
gc.set_linewidth(self._markeredgewidth)
gc.set_alpha(self._alpha)
funcname = self._markers.get(self._marker, "_draw_nothing")
if funcname != "_draw_nothing":
tpath, affine = self._transformed_path.get_transformed_points_and_affine()
markerFunc = getattr(self, funcname)
markerFunc(renderer, gc, tpath, affine.frozen())
renderer.close_group("line2d")
def get_antialiased(self):
return self._antialiased
def get_color(self):
return self._color
def get_linestyle(self):
return self._linestyle
def get_linewidth(self):
return self._linewidth
def get_marker(self):
return self._marker
def get_markeredgecolor(self):
if is_string_like(self._markeredgecolor) and self._markeredgecolor == "auto":
if self._marker in self.filled_markers:
return "k"
else:
return self._color
else:
return self._markeredgecolor
return self._markeredgecolor
def get_markeredgewidth(self):