Skip to contents

Package overview

ggpp ggpp-package
ggpp: Grammar Extensions to 'ggplot2'


Scales control de mapping of values in data to values of an aesthetic, or the propeerties of the plot’s graphic elements.

scale_npcx_continuous() scale_npcy_continuous()
Position scales for continuous data (npcx & npcy)
compute_npcx() compute_npcy() as_npcx() as_npcy() compute_npc() as_npc()
Compute NPC coordinates


Geoms, short for geometric objects, describe the type of plot you will produce. They add a plot layer containing graphic elements representing values in the data,

Annotations supporting NPC
geom_label_npc() geom_text_npc()
Text with Normalised Parent Coordinates
geom_label_s() geom_text_s()
Linked Text
geom_label_pairwise() geom_text_pairwise()
Label pairwise comparisons
Points linked by a segment
geom_x_margin_point() geom_y_margin_point()
Reference points on the margins
geom_x_margin_arrow() geom_y_margin_arrow()
Reference arrows on the margins
geom_x_margin_grob() geom_y_margin_grob()
Add Grobs on the margins
geom_quadrant_lines() geom_vhlines()
Reference lines: horizontal plus vertical, and quadrants
geom_plot() geom_plot_npc()
Inset plots
geom_grob() geom_grob_npc()
Inset graphical objects
geom_table() geom_table_npc()
Inset tables
ttheme_gtdefault() ttheme_gtminimal() ttheme_gtbw() ttheme_gtplain() ttheme_gtdark() ttheme_gtlight() ttheme_gtsimple() ttheme_gtstripes()
Table themes
Set default table theme


It is often useful to summarize data before plotting, e.g., fiting models or computing means, or modifying the data in some other way.

stat_dens1d_filter() stat_dens1d_filter_g()
Filter observations by local 1D density
Replace labels in data based on 1D density
stat_dens2d_filter() stat_dens2d_filter_g()
Filter observations by local 2D density
Replace labels in data based on 2D density
Number of observations in quadrants
stat_panel_counts() stat_group_counts()
Number of observations in a plot panel
Select and slice a tibble nested in data
stat_apply_group() stat_summary_xy() stat_centroid()
Apply a function to x or y values
Draw functions as curves


It is often useful to displace plot elements away from their original positions to obtain stacked, side-by-side or non-overlapping plot elements.

Nudge points a fixed distance
Nudge labels to new positions
position_nudge_center() position_nudge_centre()
Nudge labels away from a central point
Nudge labels away from a line
position_dodgenudge() position_dodge_keep() position_dodge2_keep() position_dodge2nudge()
Combined positions dodge and nudge
position_stacknudge() position_fillnudge() position_stack_keep() position_fill_keep() position_stack_minmax()
Combined positions stack and nudge
position_jitternudge() position_jitter_keep()
Combined positions jitter and nudge

Plot creation

Additional ggplot methods for specific classes of data objects.

ggplot(<ts>) ggplot(<xts>)
Create a new ggplot plot from time series data

Helper functions

Additional functions that can be useful when creating plots.

Chose between dark and light color
try_data_frame() try_tibble()
Convert an R object into a tibble
Wrap character strings in a vector

Example data

Data sets as R objects. The data are used for examples in the documentation.

birch.df birch_dw.df
Birch seedlings' size
Ivy photosynthesis light response
Gene expression data
Gene expression data
Weather data