ggpmisc 0.3.5

This version (0.3.5) adds to geom_table() support for table themes compatible with gridExtra::ttheme_default(). The default table-theme can be changed with function ttheme_set() and several new ttheme constructors are also available as well as support for user defined theme constructors and themes. Changes affect the rendering of tables, and add flexibility to the handling of mapped aesthetics in geom_table()

Note: The default theme for tables in version 0.3.5 uses slightly less padding than in previous versions, and this padding is now proportional to the text’s size instead of fixed. This will not break old code but can slightly change how tables look.

The plots below make use of two of the new table theme constructors. The second plot also uses ggplot2’s theme_dark().

Note: If the full flexibility of ‘gridExtra’ and ‘grid’ are needed for a table, the table can be constructed directly with these packages and added as an inset using geom_grob().

Acknowlegement: This update was encouraged by a recent question 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

ggpmisc 0.3.1

After the previous major update to ‘ggpmisc’ (0.3.0), a follow up (0.3.1) with multiple new features and smoothed rough edges for some of the features added in version 3.0.0. Package documentation is available at as a web site.

The enhancements in this and the previous update to ‘ggpmisc’ are made possible by changes to ‘ggplot2’ (>= 3.0.0) made while adding support for sf (simple features).

The functions in ‘ggpmisc’ (>= 0.3.1) are related to different kinds of annotations and insets in ggplots. Annotations of plots with fitted-model equations, fit diagnosis, ANOVA and summary tables, highlighting and labelling of peaks and valleys in curves, and local density-based highlighting or labelling in scatter plots. Additionally specializations of the ggplot() constructor allow on-the-fly conversion of time-series. Two new geoms join geom_table() added in version 0.3.0, geom_plot() and geom_grob(). These three geoms make it possible to add tables, ggplots and arbitrary graphical objects (grobs) as insets to plots respecting the the Grammar of Graphics paradigm.

Inset plot showing means per group.
Inset grobs

A set of new geometries produce marginal annotations: geom_x_margin_point(), geom_y_margin_point(), geom_x_margin_arrow(), geom_y_margin_arrow(), geom_x_margin_grob() and geom_y_margin_grob().

Marginal “points” showing means per group.

Another novel feature is based on the addition of two new aesthetics npcx and npcy, the corresponding scales scale_npcx_continuous() and scale_npcy_continuous(), and several new geometries that make use of then: geom_text_npc(), geom_label_npc(), geom_table_npc(), geom_plot_npc() and geom_grob_npc(). These allow to position insets and annotations relative to the dimensions of the plotting area instead of using native data units. Using "npc" units is more natural for labels or insets that are not directly related to data but that look better if positioned consistently across multiple panels or multiple separately produced plots. One improvement to the stats from earlier versions of ‘ggpmisc’ is the use of these new geoms to achieve more consistent location for insets and labels.

Quadrant counts with panels.
Fitted equations in panels with free y limits.
Inset tables at different positions in different panels.

As in the announcement of the previous version, I have included some example plots taken from the documentation of the package. In all cases annotations are generated automatically, but formatting is flexible.

NOTE: The new version of ‘ggpmisc’ will be soon submitted to CRAN .

from Data to Viz (external link)

from data to Viz is a new web site related to data analysis and R. Its aim is to make it easier to choose among different types of data visualisations. It looks beautiful, is easy to navigate, includes “trees” displaying a classification of visualizations and multiple individual examples with the corresponding R code.  Highly recommended!

To access the website and/or to buy the printed poster visit from Data to Viz.


gginnards 0.0.1

Package ‘gginnards’ is now in CRAN. This new package contains functions removed from ‘ggpmisc’ at version 0.3.0. The package was split as the audience the different functions are intended for is different: ‘gginnards’ is for those needing tools for programming ‘ggplot2’ extensions or wanting to learn how ggplots work. Most importantly, the functions now in ‘gginnards’ cannot be expected to survive with unchanged functionality across major updates to ‘ggplot2’, and importing them into other packages is strongly discouraged.

In contrast the functions retained in ‘ggpmisc’ and the new ones added in version 0.3.0 are intended for users creating plots for data analyses and reports. I am committed to maintaining ‘ggpmisc’ in the long term while striving to retain backwards compatibility as much as possible.

Documentation web site at includes all help pages, with output from all examples, and vignettes in HTML format.
NOTE: The package is available through CRAN.

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