Clipping Paths | R Documentation |
A feature of SVG is that elements can be clipped to by more than just
a rectangular region. Most graphical elements can be drawn. The
purpose of these functions is to define a more sophisticated clipping
path that will be applied until the current viewport (or context, see
popContext
) is popped.
clipPath(grob)
registerClipPath(label, clippath)
grob |
A grid grob. |
label |
A character identifier that will be used to reference this definition. |
clippath |
A |
A clipping path will be drawn within the current viewport at the time
of definition (if the grob has no vp
specified).
Most grobs can be used for clipping but there are some limitations on what will actually be used for clipping. In general though, anything that is drawn as the clipping path will have the union of its drawn regions become the new region that the current viewport (or grob) will clip to.
The limitations are as follows:
Any viewport pushed by the clipping path grob will no longer clip to its contents. However, its clipping region will remain. This means that the clipping region for a pushed viewport will become the union of its contents and the viewport clipping region itself, instead of just the pushed viewport's clipping region.
When drawing a textGrob
, only character labels will be
used, no plotmath
expressions will be used.
No pointGrob
s are able to be used for clipping.
Any operations that apply to containers (e.g. gpars, garnishing, animation), will no longer work. Any operations that are not applied to groups are unaffected. This affects in particular viewports, gTrees, and the familiar gridSVG grob grouping that occurs.
None
Simon Potter
popContext
, grid.clipPath
,
pushClipPath
, grid.clip
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.