matplotlib.artist.Artist.set_clip_path#

Artist.set_clip_path(path,transform=None)[source]#

Set the artist's clip path.

Parameters:
pathPatch orPath orTransformedPath or None

The clip path. If given aPath,transform must be provided aswell. IfNone, a previously set clip path is removed.

transformTransform, optional

Only used ifpath is aPath, in which case the givenPathis converted to aTransformedPath usingtransform.

Notes

For efficiency, ifpath is aRectangle this method will set theclipping box to the corresponding rectangle and set the clipping pathtoNone.

For technical reasons (support ofset), a tuple(path,transform) is also accepted as a single positionalparameter.

Examples usingmatplotlib.artist.Artist.set_clip_path#

Looking glass

Looking glass

Clipping images with patches

Clipping images with patches

Many ways to plot images

Many ways to plot images

Dolphins

Dolphins