geom_mask: Apply Manual Clipping Mask

Description Usage Author(s) Examples

View source: R/geom-mask.R

Description

This function creates a manual clipping mask, which in turn suppresses the standard clipping mask that would otherwise be rendered in the foregound rendering procedure, giving the user control over the exact placement with respect to other layers. For example, the user may wish to have the clipping mask placed after the geom_point(...) layer, but before the geom_label(...) layer, this situation has been demonstrated in the example below. In the event that the user wishes to suppress the mask altogether, then a convenience function has been provided, theme_nomask().

Usage

1

Author(s)

Nicholas Hamilton

Examples

1
2
3
4
5
6
7
8
data(Feldspar)
x = ggtern(Feldspar,aes(Ab,An,Or,label=Experiment)) + geom_point()

#Default Behaviour
x + geom_label()

#Insert manual mask before the labels, to prevent them being truncated
x + geom_point(size=6) + geom_mask() + geom_label()

Example output

Loading required package: ggplot2
--
Consider donating at: http://ggtern.com
Even small amounts (say $10-50) are very much appreciated!
Remember to cite, run citation(package = 'ggtern') for further info.
--

Attaching package: 'ggtern'

The following objects are masked from 'package:ggplot2':

    %+%, aes, annotate, calc_element, ggplot, ggplotGrob, ggplot_build,
    ggplot_gtable, ggsave, layer_data, theme, theme_bw, theme_classic,
    theme_dark, theme_gray, theme_light, theme_linedraw, theme_minimal,
    theme_void

ggtern documentation built on July 17, 2017, 5:02 p.m.