本文简要介绍 python 语言中 matplotlib.patches.ConnectionStyle 的用法。
-
基础:
_StyleConnectionStyle是一个容器类,它定义了几个连接样式类,用于创建两点之间的路径。这些主要与FancyArrowPatch一起使用。连接样式对象可以创建为:
ConnectionStyle.Arc3(rad=0.2)或者:
ConnectionStyle("Arc3", rad=0.2)或者:
ConnectionStyle("Arc3, rad=0.2")定义了以下类
类
名字
属性
Arc3
arc3弧度=0.0
Angle3
angle3角度A=90,角度B=0
Angle
angle角度A=90,角度B=0,弧度=0.0
Arc
arc角度A=0,角度B=0,臂A=无,臂B=无,弧度=0.0
Bar
bararmA=0.0,armB=0.0,分数=0.3,角度=无
任何连接样式类的实例都是可调用对象,其调用签名为:
__call__(self, posA, posB, patchA=None, patchB=None, shrinkA=2., shrinkB=2.)它返回一个
Path实例。posA和posB是要连接的两个点的 (x, y) 坐标的元组。patchA(或patchB),返回的路径被剪裁,使其从补丁的边界开始(或结束)。路径被以点数给出的shrinkA(或shrinkB)进一步缩小。返回具有给定样式名称的子类的实例。
-
class角度(angleA=90,angleB=0,rad=0.0)# -
基础:
_Base在两点之间创建分段连续二次贝塞尔路径。该路径有一个 passing-through 点,位于穿过起点和终点的两条线的交点处,斜率分别为
angleA和angleB。连接边采用rad进行倒圆处理。- 参数:
- angleA 浮点数
-
路径的起始角度。
- angleB 浮点数
-
路径的结束角度。
- rad 浮点数
-
边的圆角半径。
-
连接(
posA,posB)#
-
class角度3(angleA=90,angleB=0)# -
基础:
_Base在两点之间创建一条简单的二次贝塞尔曲线。中间控制点位于穿过起点和终点的两条线的交点,斜率分别为
angleA和angleB。- 参数:
- angleA 浮点数
-
路径的起始角度。
- angleB 浮点数
-
路径的结束角度。
-
连接(
posA,posB)#
-
class弧(angleA=0,angleB=0,armA=None,armB=None,rad=0.0)# -
基础:
_Base在两点之间创建分段连续二次贝塞尔路径。该路径可以有两个 passing-through 点,一个点放置在距 A 点
armA的距离和angleA角度处,另一个点相对于点 B。边用rad进行圆化。- 参数:
- angleA 浮点数
-
路径的起始角度。
- angleB 浮点数
-
路径的结束角度。
- armA 浮点数或无
-
起始臂的长度。
- armB 浮点数或无
-
末端臂的长度。
- rad 浮点数
-
边的圆角半径。
-
连接(
posA,posB)#
-
class弧3(rad=0.0)# -
基础:
_Base在两点之间创建一条简单的二次贝塞尔曲线。创建曲线时,中间控制点 (C1) 与起点 (C0) 和终点 (C2) 的距离相同,并且 C1 到连接 C0-C2 的线的距离是
rad乘以C0-C2的距离。- 参数:
- rad 浮点数
-
曲线的曲率。
-
连接(
posA,posB)#
-
class酒吧(armA=0.0,armB=0.0,fraction=0.3,angle=None)# -
基础:
_BaseA 和 B 之间有一条
angle线,其中有armA和armB。其中一根臂伸出,以便它们以直角连接。armA的长度由(armA+fractionx AB 距离) 确定。对于armB来说也是如此。- 参数:
- armA 浮点数
-
A 臂的最小长度。
- armB 浮点数
-
臂的最小长度 B.
- fraction 浮点数
-
将添加到 armA 和 armB 的两点之间的距离的一部分。
- angle 浮点数或无
-
连接线的角度(如果无,则平行于 A 和 B)。
-
连接(
posA,posB)#
-
用法
class matplotlib.patches.ConnectionStyle(stylename, **kwargs)
相关用法
- Python matplotlib ConciseDateFormatter用法及代码示例
- Python matplotlib ColorSequenceRegistry用法及代码示例
- Python matplotlib ColormapRegistry用法及代码示例
- Python matplotlib Collection.sticky_edges用法及代码示例
- Python matplotlib Collection.set_hatch用法及代码示例
- Python matplotlib CircleCollection.set_hatch用法及代码示例
- Python matplotlib CircleCollection.sticky_edges用法及代码示例
- Python matplotlib CenteredNorm用法及代码示例
- Python matplotlib CallbackRegistry用法及代码示例
- Python matplotlib axvspan用法及代码示例
- Python matplotlib Axes.get_legend_handles_labels用法及代码示例
- Python matplotlib AbstractMovieWriter用法及代码示例
- Python matplotlib triplot用法及代码示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代码示例
- Python matplotlib Axes.hist用法及代码示例
- Python matplotlib boxplot用法及代码示例
- Python matplotlib subplots用法及代码示例
- Python matplotlib InsetPosition用法及代码示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代码示例
- Python matplotlib Figure.set_size_inches用法及代码示例
- Python matplotlib figlegend用法及代码示例
- Python matplotlib Axes.step用法及代码示例
- Python matplotlib Axes.contour用法及代码示例
- Python matplotlib LassoSelector用法及代码示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代码示例
注:本文由纯净天空筛选整理自skytowner.com大神的英文原创作品 matplotlib.patches.ConnectionStyle。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
