A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mpl-visual-context.readthedocs.io/en/latest/api_path_effect.html below:

Website Navigation


PathEffect — mpl_visual_context 0.9.3 documentation

PathEffect Multiple Strokes

Glow

Patheffect with glow effect.

CmapGlow

Patheffect similar to Glow, but with different colors basedon the given colormap.

ImageEffect API

Collection of PathEffects classes.

Most of the PathEffects that inherit from ChainablePathEffect, and they can be pipelined using a | operator to make a custom patheffects. For example, “Smooth() | FillColor(‘r’)`” will smooth the path and fill the region in red.

These are list of patheffects currently available.

Note that PathEffects classified as “other (non-chainable)” are not inherited from ChainablePathEffect. They can be used in the pipeline but should be at the end (or immediatenly followed by ImageEffect, see below), i.e., “FillColor(‘r’) | Glow()” is okay but “Glow() | FillColor(‘r’)” is not.

The ImageEffect is very special. It should be at the end of the pipeline, even after other non-chainable PathEffects. It is a patheffect version of MPL’s agg filter. It will render the artist (w/ path effects in the pipeline) as an image (using the Agg backend), apply image processing (e.g., GaussianBlur), then place the image at the canvas.

class mpl_visual_context.patheffects.Affine(affine=None)

Bases: ChainablePathEffect

PathEffect to apply affine trasnform the path. Note that this is applied before the affine of the path (this was intended to transform the text path)

Methods

draw_path

rotate_deg

scale

skew_deg

translate

rotate_deg(degrees)
scale(sx, sy=None)
skew_deg(xShear, yShear)
translate(tx, ty)
class mpl_visual_context.patheffects.AlphaGradient(alphas, extent=None, bbox=None, coords=None, axes=None, **im_kw)

Bases: GradientBase

Fill the path with image of the fill color of the path, with varying transparency.

Methods

draw_path(renderer, gc, tpath, affine, rgbFace)

Derived should override this method.

draw_path(renderer, gc, tpath, affine, rgbFace)

Derived should override this method. The arguments are the same as matplotlib.backend_bases.RendererBase.draw_path() except the first argument is a renderer.

get_image_box()
class mpl_visual_context.patheffects.ClipPathFromPatch(patch)

Bases: ChainablePathEffect

PathEffect that clips the path using a provided patch.

Methods

class mpl_visual_context.patheffects.ClipPathSelf

Bases: ChainablePathEffect

PathEffect that sets the clip_path to the path itself. This is useful when the path is modified down in the pipeline.

Methods

class mpl_visual_context.patheffects.ClipRect(ax, left=None, bottom=None, right=None, top=None, coords='data')

Bases: ChainablePathEffect

PathEffect that modifies the clip_rect using the given coordinate (and transform). In most case, the default clip_rect is the bbox of the axes.

Methods

class mpl_visual_context.patheffects.Clipboard(renderer=False, gc=True, tpath=True, affine=True, rgbFace=True)

Bases: ClipboardBase, dict

Methods

clear()

copy()

fromkeys(iterable[, value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(key[, default])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem(/)

Remove and return a (key, value) pair as a 2-tuple.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

get_clip_path

get_path

paste

copy() a shallow copy of D
get_clip_path()
get_path()
paste()
class mpl_visual_context.patheffects.CmapGlow(cmap, nlevel=10, diff_linewidth=5, alpha_line: float = 0.3, xoffset=0, yoffset=0)

Bases: AbstractPathEffect

Patheffect similar to Glow, but with different colors basedon the given colormap.

Methods

draw_path(renderer, gc, tpath, affine, rgbFace)

Draw the path with updated gc.

draw_path(renderer, gc, tpath, affine, rgbFace)

Draw the path with updated gc.

class mpl_visual_context.patheffects.ColorMatrix(kind)

Bases: ColorModifyStroke

PathEffect which modifies the color in RGB space, using a predefined color matrix. Supported matrix are ‘grayscale’, ‘sepia’, ‘nightvision’, ‘warm’ and ‘cool. Both stroke and fill color are changed.

Methods

apply_to_color(c)
color_matrix = {'cool': array([[0.99, 0.  , 0.  ],        [0.  , 0.93, 0.  ],        [0.  , 0.  , 1.08]]), 'grayscale': array([[0.299, 0.587, 0.114],        [0.299, 0.587, 0.114],        [0.299, 0.587, 0.114]]), 'nightvision': array([[0.1, 0.4, 0. ],        [0.3, 1. , 0.3],        [0. , 0.4, 0.1]]), 'sepia': array([[0.393, 0.769, 0.189],        [0.349, 0.686, 0.168],        [0.272, 0.534, 0.131]]), 'warm': array([[1.06, 0.  , 0.  ],        [0.  , 1.01, 0.  ],        [0.  , 0.  , 0.93]])}
class mpl_visual_context.patheffects.FillColor(fillcolor)

Bases: ChainablePathEffect

PathEffect to set the fill color

Methods

class mpl_visual_context.patheffects.FillColorFromStrokeColor

Bases: ChainablePathEffect

PathEffect to set the fill color by the stroke color

Methods

class mpl_visual_context.patheffects.FillImage(im, ax=None, remove_from_axes=False, alpha=None, **kwargs)

Bases: AbstractPathEffect

Fill the path with the given image. It actually draws the image with its clip_path set to the path itself.

Methods

draw_path(renderer, gc, tpath, affine, rgbFace)

Derived should override this method.

draw_path(renderer, gc, tpath, affine, rgbFace)

Derived should override this method. The arguments are the same as matplotlib.backend_bases.RendererBase.draw_path() except the first argument is a renderer.

class mpl_visual_context.patheffects.FillOnly

Bases: ChainablePathEffect

PathEffect with only fill. This is done by setting the linewidth to 0.

Methods

class mpl_visual_context.patheffects.GCModify(**kwargs)

Bases: ChainablePathEffect

Methods

class mpl_visual_context.patheffects.Glow(n_glow_lines: int = 10, diff_linewidth: float = 1.05, alpha_line: float = 0.3, offset=(0, 0))

Bases: AbstractPathEffect

Patheffect with glow effect. Adopted from mplcybepunk. Each existing line is redrawn several times with increasing width and low alpha to create the glow effect.

Methods

draw_path(renderer, gc, tpath, affine, rgbFace)

Draw the path with updated gc.

draw_path(renderer, gc, tpath, affine, rgbFace)

Draw the path with updated gc.

class mpl_visual_context.patheffects.Gradient(data, alpha=None, extent=None, bbox=None, coords=None, axes=None, **im_kw)

Bases: GradientBase

Methods

draw_path(renderer, gc, tpath, affine, rgbFace)

Derived should override this method.

get_image_box()
class mpl_visual_context.patheffects.HLSModify(h='100%', l='100%', s='100%', alpha='100%', dh=0, dl=0, ds=0, dalpha=0, clip_mode='clip')

Bases: HLSaxb

PathEffect which modifies the color in HLS space. Both stroke and fill color are changed.

Methods

class mpl_visual_context.patheffects.HLSaxb(h_ab=(1, 0), l_ab=(1, 0), s_ab=(1, 0), alpha_ab=(1, 0), clip_mode='clip')

Bases: ColorModifyStroke

PathEffect which modifies the color in HLS space. Given a tuple of (a, b), the new color is defiend as h’ = a * h + b, and so on. Both stroke and fill color are changed.

Methods

apply_to_color(c)
class mpl_visual_context.patheffects.ImageEffect(image_effect, clip_path_getter=None, invisible_if_nill_clip_path=True)

Bases: AbstractPathEffect, ImageEffectBase

Methods

clear

draw_path

draw_with_path_effect

get_image

get_rendered_image

init_renderer

update_gc_n_affine

draw_path(renderer, gc, tpath, affine, rgbFace)
get_image(renderer, gc, tpath, affine, rgbFace)
class mpl_visual_context.patheffects.Offset(ox, oy)

Bases: ChainablePathEffect

PathEffect that offsets the path.

Methods

class mpl_visual_context.patheffects.Open

Bases: ChainablePathEffect

PathEffect with no closed with. This is done by replacin CLOSEPOLY code to STOP.

Methods

class mpl_visual_context.patheffects.Partial(start, stop)

Bases: ChainablePathEffect

PathEffect with that preserve only a part of the path. It only support lines (no bezier splines).

Methods

class mpl_visual_context.patheffects.PostAffine(affine=None)

Bases: Affine

Similar to Affine, but it will be applied after the path’s affine.

Methods

draw_path

rotate_deg

scale

skew_deg

translate

class mpl_visual_context.patheffects.Recenter(axes, ox, oy, coords='data', sign=1)

Bases: ChainablePathEffect

PathEffect that apply offsets so that the given points to be zero.

Methods

restore()
class mpl_visual_context.patheffects.RoundCorner(round_size=20, i_selector=None)

Bases: ChainablePathEffect

Methods

mpl_visual_context.patheffects.Skew(xShear, yShear)
class mpl_visual_context.patheffects.Smooth(skip_incompatible=False)

Bases: ChainablePathEffect

PathEffect that transform the given lines to smooth bezier path. If the path is not line (not closed), the path is not changed.

Methods

class mpl_visual_context.patheffects.SmoothFillBetween(skip_incompatible=False, skip_first_n=0)

Bases: Smooth

PathEffect that transform a patch created by fill_between to a smooth nezier path. It assumes that the patch is consist of two lines (one for upper/left boundary another for lower/right boundary), which are smoothed separately then combined.

Methods

class mpl_visual_context.patheffects.StrokeColor(c)

Bases: ChainablePathEffect

PathEffect to set the stoke color

Methods

class mpl_visual_context.patheffects.StrokeColorFromFillColor

Bases: ChainablePathEffect

PathEffect to set the stoke color by the fill color

Methods

class mpl_visual_context.patheffects.StrokeOnly

Bases: ChainablePathEffect

PathEffect with only stroke. This is done by setting the fill color to None.

Methods


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4