Extensions to 'ggplot2' respecting the grammar of graphics paradigm. Geometries: geom_table(), geom_plot() and geom_grob() add insets to plots using native data coordinates, while geom_table_npc(), geom_plot_npc() and geom_grob_npc() do the same using "npc" coordinates through new aesthetics "npcx" and "npcy". Statistics: select observations based on 2D density. Positions: radial nudging away from a center point and nudging away from a line or curve; combined stacking and nudging; combined dodging and nudging.
Details
Package 'ggpp' provides functions that extend the grammar of graphics as implemented in 'ggplot2'. It attempts to stay true to the original grammar and to respect the naming conventions used in 'ggplot2'.
Extensions provided:
Geoms adding support for plot, table and grob insets within the gramamr. Geoms using a parallel pseudo-scale based on native plot coordinates (npc) to allow annotations consistent with the grammar and so supporting facets and grouping. Geoms for annotations on the edges of the plotting area. Geom for easily drawing lines separating the quadrants of a plot.
Stats for filtering-out/filtering-in observations in regions of a panel or group where the density of observations is high. Statistics simultaneously computing summaries, optionally using different functions, along x and y. Stat computing quadrant counts.
Position functions implementing multi-directional nudging based on the data.
Scales. Pseudo-scales supporting npc coordinates for x and y.
Specializations of the
ggplot()
generic accepting time series objects of classests
andxts
as data argument.
Acknowledgements
We thank Kamil Slowikowski not only for
contributing ideas and code examples to this package but also for adding
new features to his package 'ggrepel' that allow new use cases for
stat_dens2d_labels()
, position_nudge_center()
,
position_nudge_line()
and position_nudge_to()
from this
package. This package includes code copied and/or modified from
that in package 'ggplot2'.
References
Package 'ggplot2' documentation is available at
https://ggplot2.tidyverse.org/
Package 'ggplot2' source code at
https://github.com/tidyverse/ggplot2