ggpmisc 0.3.7

Package ‘ggpmisc’ focuses mainly on plot annotations. The new version adds features that I hope will be found useful.

Package documentation web site at:

Changes from version 0.3.6 the most recent CRAN release, are:


Filtering based on 1D density

Three new statistics stat_dens1d_filter(), stat_dens1d_filter_g() and stat_dens1d_labels() are 1D versions of the existing 2D functions which received a minor update.

  • Add stat_dens1d_filter(), stat_dens1d_filter_g() and stat_dens1d_labels(), to complement existing stat_dens2d_filter(), stat_dens2d_filter_g() and stat_dens2d_labels().
  • Update stat_dens2d_filter(), stat_dens2d_filter_g() and stat_dens2d_labels() adding formal parameters keep.sparse and invert.selection, as available in the new 1D versions.
  • Update stat_dens2d_labels() to accept not only character strings but also functions as argument to label.fill as the new stat_dens1d_labels() does.

Table insets and their formatting

Updates to statistics stat_fmt_tb() and stat_fit_tb() add flexibility.

  • Update stat_fit_tb() to support renaming of terms/parameter names in the table (Suggested by Big Old Dave and Z. Lin). In addition implement selection, reordering and renaming of columns and terms/parameters using positional indexes and pattern matching of truncated names in addition to whole names. Improve formatting of small P-values.
  • Update stat_fmt_tb() to support the same expanded syntax as stat_fit_tb().

Here is an example for an ANOVA table inset.

formula <- y ~ x
ggplot(PlantGrowth, aes(group, weight)) +
  stat_summary( = "mean_se") +
  stat_fit_tb(method = "lm",
              method.args = list(formula = formula),
              tb.type = "fit.anova",
              tb.vars = c(Term = "term", "df", "M.S." = "meansq",
                          "italic(F)" = "statistic",
                          "italic(p)" = "p.value"),
              tb.params = c("Group" = 1, "Error" = 2),
              table.theme = ttheme_gtbw(parse = TRUE)) +
  labs(x = "Group", y = "Dry weight of plants") +


Acknowlegement: This update was encouraged by recent questions at stackoverflow. The tag [ggpmisc] is in use at stackoverflow for questions related to this package.

Documentation web site at includes all help pages, with output from all examples, and vignettes in HTML format.

NOTE: The new version of the package is on its way to CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket

Share with

Leave a Reply