For a visual impression of each JoinStyle, :None:None:`view these docs online
<JoinStyle>`, or run :None:None:`JoinStyle.demo`.
Lines in Matplotlib are typically defined by a 1D ~.path.Path
and a finite linewidth
, where the underlying 1D ~.path.Path
represents the center of the stroked line.
By default, ~.backend_bases.GraphicsContextBase
defines the boundaries of a stroked line to simply be every point within some radius, linewidth/2
, away from any point of the center line. However, this results in corners appearing "rounded", which may not be the desired behavior if you are drawing, for example, a polygon or pointed star.
Supported values:
.. rst-class:: value-list
'miter'
the "arrow-tip" style. Each boundary of the filled-in area will
extend in a straight line parallel to the tangent vector of the
centerline at the point it meets the corner, until they meet in a
sharp point.
'round'
stokes every point within a radius of ``linewidth/2`` of the center
lines.
'bevel'
the "squared-off" style. It can be thought of as a rounded corner
where the "circular" part of the corner has been cut off.
Very long miter tips are cut off (to form a bevel) after a backend-dependent limit called the "miter limit", which specifies the maximum allowed ratio of miter length to line width. For example, the PDF backend uses the default value of 10 specified by the PDF standard, while the SVG backend does not even specify the miter limit, resulting in a default value of 4 per the SVG specification. Matplotlib does not currently allow the user to adjust this parameter.
A more detailed description of the effect of a miter limit can be found in the :None:None:`Mozilla Developer Docs
<https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit>`
.. plot::
('alt', "Demo of possible JoinStyle's")
from matplotlib._enums import JoinStyle
JoinStyle.demo()
Define how the connection between two line segments is drawn.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.axes._axes.Axes.broken_barhmatplotlib.artist.Patch.setmatplotlib.patches.RegularPolygon.__init__matplotlib.axes._axes.Axes.coherematplotlib.patches.Patch.set_joinstylematplotlib.artist.AsteriskPolygonCollection.setmatplotlib.artist.QuadMesh.setmatplotlib.pyplot.errorbarmatplotlib.collections.Collection.set_joinstylematplotlib.pyplot.angle_spectrummatplotlib.artist.CirclePolygon.setmatplotlib.axes._axes.Axes.quivermatplotlib.pyplot.pcolormatplotlib.axes._axes.Axes.magnitude_spectrummatplotlib.patches.Wedge.__init__matplotlib.artist.BrokenBarHCollection.setmatplotlib.pyplot.fill_betweenmatplotlib.patches.Polygon.__init__matplotlib.artist.StepPatch.setmatplotlib.pyplot.axvlinematplotlib.pyplot.axvspanmatplotlib.axes._axes.Axes.axhlinematplotlib.patches.PathPatch.__init__matplotlib.artist.PathCollection.setmatplotlib.axes._axes.Axes.barbsmatplotlib.artist.PatchCollection.setmatplotlib.patches.FancyArrowPatch.__init__matplotlib.artist.Ellipse.setmatplotlib.patches.FancyArrow.__init__matplotlib.axes._axes.Axes.phase_spectrummatplotlib.axes._axes.Axes.axhspanmatplotlib.artist.Shadow.setmatplotlib.pyplot.barbsmatplotlib.patches.Patch.__init__matplotlib.artist.Rectangle.setmatplotlib.patches.Circle.__init__matplotlib.patches.Arrow.__init__matplotlib.artist.RegularPolygon.setmatplotlib.artist.FancyArrowPatch.setmatplotlib.axes._axes.Axes.fill_betweenmatplotlib.artist.PolyCollection.setmatplotlib.artist.LineCollection.setmatplotlib.lines.Line2D.__init__matplotlib.pyplot.psdmatplotlib.pyplot.plotmatplotlib.artist.Line2D.setmatplotlib.patches.FancyBboxPatch.__init__matplotlib.axes._axes.Axes.arrowmatplotlib.pyplot.barmatplotlib.pyplot.axhspanmatplotlib.pyplot.csdmatplotlib.artist.CircleCollection.setmatplotlib.axes._axes.Axes.hexbinmatplotlib.axes._axes.Axes.spymatplotlib.axes._axes.Axes.fill_betweenxmatplotlib.axes._axes.Axes.pcolormatplotlib.patches.CirclePolygon.__init__matplotlib.quiver.Barbs.__init__matplotlib.artist.Wedge.setmatplotlib.pyplot.pcolormeshmatplotlib.artist.Collection.setmatplotlib.artist.TriMesh.setmatplotlib.pyplot.hexbinmatplotlib.artist.Spine.setmatplotlib.axes._axes.Axes.barmatplotlib.patches.Ellipse.__init__matplotlib.patches.StepPatch.__init__matplotlib.patches.Rectangle.__init__matplotlib.axes._axes.Axes.indicate_insetmatplotlib.patches.Shadow.__init__matplotlib.spines.Spine.__init__matplotlib.pyplot.plot_datematplotlib.artist.Arrow.setmatplotlib.pyplot.spymatplotlib.artist.Annulus.setmatplotlib.artist.Polygon.setmatplotlib.pyplot.axlinematplotlib.axes._axes.Axes.pcolormeshmatplotlib.pyplot.gridmatplotlib.patches.Arc.__init__matplotlib.pyplot.barhmatplotlib.artist._CollectionWithSizes.setmatplotlib.sankey.Sankey.addmatplotlib.artist.PathPatch.setmatplotlib.axes._axes.Axes.plotmatplotlib.patches.Annulus.__init__matplotlib.artist.EventCollection.setmatplotlib.pyplot.fill_betweenxmatplotlib.artist.StarPolygonCollection.setmatplotlib.artist.Cell.setmatplotlib.quiver.Quiver.__init__matplotlib.artist.FancyBboxPatch.setmatplotlib.artist.EllipseCollection.setmatplotlib.artist.ConnectionPatch.setmatplotlib.artist._ColorbarSpine.setmatplotlib.artist.Arc.setmatplotlib.axes._axes.Axes.axlinematplotlib.artist.RegularPolyCollection.setmatplotlib.artist.Barbs.setmatplotlib.axes._axes.Axes.axvspanmatplotlib.lines.Line2D.get_solid_joinstylematplotlib.artist.Circle.setmatplotlib.lines.Line2D.get_dash_joinstylematplotlib.pyplot.coherematplotlib._enums.CapStylematplotlib.pyplot.magnitude_spectrummatplotlib.axes._base._AxesBase.gridmatplotlib.axes._axes.Axes.psdmatplotlib.pyplot.phase_spectrummatplotlib.axes._axes.Axes.csdmatplotlib.axes._axes.Axes.plot_datematplotlib.pyplot.quivermatplotlib.artist._AxLine.setmatplotlib.pyplot.broken_barhmatplotlib.axes._axes.Axes.barhmatplotlib.axes._axes.Axes.angle_spectrummatplotlib.axes._axes.Axes.axvlinematplotlib.artist.FancyArrow.setmatplotlib.pyplot.arrowmatplotlib.pyplot.axhlinematplotlib.backend_bases.GraphicsContextBase.get_joinstylematplotlib.axes._axes.Axes.errorbarmatplotlib.artist.Quiver.setHover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them