matplotlib.patches.ConnectionStyle#

classmatplotlib.patches.ConnectionStyle(stylename,**kwargs)[source]#

Bases:_Style

ConnectionStyle is a container class which definesseveral connectionstyle classes, which is used to create a pathbetween two points. These are mainly used withFancyArrowPatch.

A connectionstyle object can be either created as:

ConnectionStyle.Arc3(rad=0.2)

or:

ConnectionStyle("Arc3",rad=0.2)

or:

ConnectionStyle("Arc3, rad=0.2")

The following classes are defined

Class

Name

Parameters

Arc3

arc3

rad=0.0

Angle3

angle3

angleA=90, angleB=0

Angle

angle

angleA=90, angleB=0, rad=0.0

Arc

arc

angleA=0, angleB=0, armA=None, armB=None, rad=0.0

Bar

bar

armA=0.0, armB=0.0, fraction=0.3, angle=None

An instance of any connection style class is a callable object,whose call signature is:

__call__(self,posA,posB,patchA=None,patchB=None,shrinkA=2.,shrinkB=2.)

and it returns aPath instance.posA andposB aretuples of (x, y) coordinates of the two points to beconnected.patchA (orpatchB) is given, the returned path isclipped so that it start (or end) from the boundary of thepatch. The path is further shrunk byshrinkA (orshrinkB)which is given in points.

Return the instance of the subclass with the given style name.

classAngle(angleA=90,angleB=0,rad=0.0)[source]#

Bases:_Base

Creates a piecewise continuous quadratic Bézier path between twopoints. The path has a one passing-through point placed at theintersecting point of two lines which cross the start and end point,and have a slope ofangleA andangleB, respectively.The connecting edges are rounded withrad.

Parameters:
angleAfloat

Starting angle of the path.

angleBfloat

Ending angle of the path.

radfloat

Rounding radius of the edge.

connect(posA,posB)[source]#
classAngle3(angleA=90,angleB=0)[source]#

Bases:_Base

Creates a simple quadratic Bézier curve between two points. The middlecontrol point is placed at the intersecting point of two lines whichcross the start and end point, and have a slope ofangleA andangleB, respectively.

Parameters:
angleAfloat

Starting angle of the path.

angleBfloat

Ending angle of the path.

connect(posA,posB)[source]#
classArc(angleA=0,angleB=0,armA=None,armB=None,rad=0.0)[source]#

Bases:_Base

Creates a piecewise continuous quadratic Bézier path between twopoints. The path can have two passing-through points, apoint placed at the distance ofarmA and angle ofangleA frompoint A, another point with respect to point B. The edges arerounded withrad.

Parameters:
angleAfloat

Starting angle of the path.

angleBfloat

Ending angle of the path.

armAfloat or None

Length of the starting arm.

armBfloat or None

Length of the ending arm.

radfloat

Rounding radius of the edges.

connect(posA,posB)[source]#
classArc3(rad=0.0)[source]#

Bases:_Base

Creates a simple quadratic Bézier curve between twopoints. The curve is created so that the middle control point(C1) is located at the same distance from the start (C0) andend points(C2) and the distance of the C1 to the lineconnecting C0-C2 israd times the distance of C0-C2.

Parameters:
radfloat

Curvature of the curve.

connect(posA,posB)[source]#
classBar(armA=0.0,armB=0.0,fraction=0.3,angle=None)[source]#

Bases:_Base

A line withangle between A and B witharmA andarmB. One of thearms is extended so that they are connected in a right angle. Thelength ofarmA is determined by (armA +fraction x AB distance).Same forarmB.

Parameters:
armAfloat

Minimum length of armA.

armBfloat

Minimum length of armB.

fractionfloat

A fraction of the distance between two points that will beadded to armA and armB.

anglefloat or None

Angle of the connecting line (if None, parallel to A and B).

connect(posA,posB)[source]#