| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/../patheffects_api.html | [Back] [Original] |
matplotlib.patheffects#Defines classes for path effects. The path effects are supported in Text,
Line2D and Patch.
See also
Bases: object
A base class for path effects.
Subclasses should override the draw_path method to add effect
functionality.
The (x, y) offset to apply to the path, measured in points.
Derived should override this method. The arguments are the same
as matplotlib.backend_bases.RendererBase.draw_path()
except the first argument is a renderer.
Bases: AbstractPathEffect
The "identity" PathEffect.
The Normal PathEffect's sole purpose is to draw the original artist with no special path effect.
The (x, y) offset to apply to the path, measured in points.
Bases: RendererBase
Implements a Renderer which contains another renderer.
This proxy then intercepts draw calls, calling the appropriate
AbstractPathEffect draw method.
Note
Not all methods have been overridden on this RendererBase subclass. It may be necessary to add further methods to extend the PathEffects capabilities further.
AbstractPathEffectThe path effects which this renderer represents.
RendererBase subclassDraw a marker at each of path's vertices (excluding control points).
The base (fallback) implementation makes multiple calls to draw_path.
Backends may want to override this method in order to draw the marker
only once and reuse it multiple times.
Draw a Path instance using the given affine transform.
Draw a collection of paths.
Each path is first transformed by the corresponding entry in all_transforms (a list of (3, 3) matrices) and then by master_transform. They are then translated by the corresponding entry in offsets, which has been first transformed by offset_trans.
facecolors, edgecolors, linewidths, linestyles, antialiased and hatchcolors are lists that set the corresponding properties.
Added in version 3.11: Allow hatchcolors to be specified.
offset_position is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to draw_path.
Backends may want to override this in order to render each set of
path data only once, and then reference that path multiple times with
the different offsets, colors, styles etc. The generator methods
_iter_collection_raw_paths and _iter_collection are provided to
help with (and standardize) the implementation across backends. It
is highly recommended to use those generators, so that changes to the
behavior of draw_path_collection can be made globally.
Bases: AbstractPathEffect
Draws a PathPatch instance whose Path comes from the original
PathEffect artist.
The (x, y) offset to apply to the path, in points.
All keyword arguments are passed through to the
PathPatch constructor. The
properties which cannot be overridden are "path", "clip_box"
"transform" and "clip_path".
Derived should override this method. The arguments are the same
as matplotlib.backend_bases.RendererBase.draw_path()
except the first argument is a renderer.
Bases: AbstractPathEffect
A simple shadow via a line.
The (x, y) offset to apply to the path, in points.
The shadow color.
A value of None takes the original artist's color
with a scale factor of rho.
The alpha transparency of the created shadow patch.
A scale factor to apply to the rgbFace color if shadow_color
is None.
Extra keywords are stored and passed through to
AbstractPathEffect._update_gc().
Bases: AbstractPathEffect
A simple shadow via a filled patch.
The (x, y) offset of the shadow in points.
The shadow color.
The alpha transparency of the created shadow patch.
A scale factor to apply to the rgbFace color if shadow_rgbFace is not specified.
Extra keywords are stored and passed through to
AbstractPathEffect._update_gc().
Bases: AbstractPathEffect
A line based PathEffect which re-draws a stroke.
The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values.
Bases: AbstractPathEffect
A line-based PathEffect which draws a path with a ticked style.
This line style is frequently used to represent constraints in optimization. The ticks may be used to indicate that one side of the line is invalid or to represent a closed boundary of a domain (i.e. a wall or the edge of a pipe).
The spacing, length, and angle of ticks can be controlled.
This line style is sometimes referred to as a hatched line.
See also the TickedStroke patheffect example.
The (x, y) offset to apply to the path, in points.
The spacing between ticks in points.
The angle between the path and the tick in degrees. The angle is measured as if you were an ant walking along the curve, with zero degrees pointing directly ahead, 90 to your left, -90 to your right, and 180 behind you. To change side of the ticks, change sign of the angle.
The length of the tick relative to spacing. Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0 when angle=90 and length=2.0 when angle=60.
Extra keywords are stored and passed through to
AbstractPathEffect._update_gc().
Examples
Bases: SimplePatchShadow
A shortcut PathEffect for applying SimplePatchShadow and then
drawing the original Artist.
With this class you can use
artist.set_path_effects([patheffects.withSimplePatchShadow()])
as a shortcut for
artist.set_path_effects([patheffects.SimplePatchShadow(),
patheffects.Normal()])
The (x, y) offset of the shadow in points.
The shadow color.
The alpha transparency of the created shadow patch.
A scale factor to apply to the rgbFace color if shadow_rgbFace is not specified.
Extra keywords are stored and passed through to
AbstractPathEffect._update_gc().
Bases: Stroke
A shortcut PathEffect for applying Stroke and then
drawing the original Artist.
With this class you can use
artist.set_path_effects([patheffects.withStroke()])
as a shortcut for
artist.set_path_effects([patheffects.Stroke(),
patheffects.Normal()])
The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values.
Bases: TickedStroke
A shortcut PathEffect for applying TickedStroke and then
drawing the original Artist.
With this class you can use
artist.set_path_effects([patheffects.withTickedStroke()])
as a shortcut for
artist.set_path_effects([patheffects.TickedStroke(),
patheffects.Normal()])
The (x, y) offset to apply to the path, in points.
The spacing between ticks in points.
The angle between the path and the tick in degrees. The angle is measured as if you were an ant walking along the curve, with zero degrees pointing directly ahead, 90 to your left, -90 to your right, and 180 behind you. To change side of the ticks, change sign of the angle.
The length of the tick relative to spacing. Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0 when angle=90 and length=2.0 when angle=60.
Extra keywords are stored and passed through to
AbstractPathEffect._update_gc().
Examples
| Web Proxy Viewer | New URL | Original Page |