本文整理汇总了Python中matplotlib.collections.PatchCollection.set_transform方法的典型用法代码示例。如果您正苦于以下问题:Python PatchCollection.set_transform方法的具体用法?Python PatchCollection.set_transform怎么用?Python PatchCollection.set_transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.collections.PatchCollection
的用法示例。
在下文中一共展示了PatchCollection.set_transform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: polar_line_circles
# 需要导入模块: from matplotlib.collections import PatchCollection [as 别名]
# 或者: from matplotlib.collections.PatchCollection import set_transform [as 别名]
def polar_line_circles(radii, theta, start_r=0):
circles = [ mpatches.Circle( (0,0), radii[0] ) ]
line_xfm = mxfms.Affine2D().translate(start_r,0).rotate(theta)
x = 0
for ri in range(1, len(radii)):
x += radii[ri-1] + radii[ri]
circles.append(mpatches.Circle( (x,0), radii[ri] ))
collection = PatchCollection(circles)
collection.set_transform(line_xfm)
return collection
示例2: spiral_trials
# 需要导入模块: from matplotlib.collections import PatchCollection [as 别名]
# 或者: from matplotlib.collections.PatchCollection import set_transform [as 别名]
def spiral_trials(radii, x=0.0, y=0.0):
radii = np.array(radii)
circles = []
if radii.size > 0:
spiral = hex_pack(radii[0], len(radii))
for i,radius in enumerate(radii):
circles.append(mpatches.Circle((spiral[i][0], spiral[i][1]), radii[i]))
pos_xfm = mxfms.Affine2D().translate(x,y)
collection = PatchCollection(circles)
collection.set_transform(pos_xfm)
return collection
示例3: _get_fpt_ell_collection
# 需要导入模块: from matplotlib.collections import PatchCollection [as 别名]
# 或者: from matplotlib.collections.PatchCollection import set_transform [as 别名]
def _get_fpt_ell_collection(dm, fpts, T_data, alpha, edgecolor):
ell_patches = []
for (x, y, a, c, d) in fpts: # Manually Calculated sqrtm(inv(A))
with catch_warnings():
simplefilter("ignore")
aIS = 1 / sqrt(a)
cIS = (c / sqrt(a) - c / sqrt(d)) / (a - d + eps(1))
dIS = 1 / sqrt(d)
transEll = Affine2D([(aIS, 0, x), (cIS, dIS, y), (0, 0, 1)])
unitCirc1 = Circle((0, 0), 1, transform=transEll)
ell_patches = [unitCirc1] + ell_patches
ellipse_collection = PatchCollection(ell_patches)
ellipse_collection.set_facecolor("none")
ellipse_collection.set_transform(T_data)
ellipse_collection.set_alpha(alpha)
ellipse_collection.set_edgecolor(edgecolor)
return ellipse_collection