matplotlib.artist.Artist.set_clip_path#

Artist.set_clip_path(path, transform=None)[源代码][源代码]#

设置艺术家的剪切路径。

参数:
路径 : PatchPathTransformedPath 或 None补丁或路径或变换路径或无

剪切路径。如果给定一个 Path,则必须同时提供 transform。如果为 None,则移除之前设置的剪切路径。

变换 : Transform, 可选转换,可选

仅在 pathPath 时使用,在这种情况下,给定的 Path 使用 transform 转换为 TransformedPath

注释

为了提高效率,如果 path 是一个 Rectangle ,此方法将把裁剪框设置为相应的矩形,并将裁剪路径设置为 None

出于技术原因(支持 set),一个元组(路径, 变换)也可以作为单个位置参数被接受。

使用 matplotlib.artist.Artist.set_clip_path 的示例#

使用补丁裁剪图像

Clipping images with patches

多种绘制图像的方法

Many ways to plot images

海豚

Dolphins

镜子

Looking glass