Press "Enter" to skip to content

Improving Plots With ggformula

Sebastian Sauer shows how you can use the ggformula package combined with ggplot2 to enhance your R visuals:

Since some time, there’s a wrapper for ggplot2 available, bundled in the package ggformula. One nice thing is that in that it plays nicely with the popular R package mosaicmosaic provides some useful functions for modeling along with a tamed and consistent syntax. In this post, we will discuss some “ornaments”, that is, some details of beautification of a plot. I confess that every one will deem it central, but in some cases in comes in handy to know how to “refine” a plot using ggformula.

Note that this “refinement” is primarily controlled via the function gf_refine() (most stuff), gf_lab() (for labs), and gf_lims() (for axis limits). Themes can be adjusted using gf_theme().

Click through for several examples.