While ggplot2 (and its various extensions) is often the go-to package for graphics in R these days, if you need to step outside the boundaries of what ggplot2 can do, you can always step back to base R graphics (and the built-in lattice package) and customize to your hearts content.
The problem is that (unlike for ggplot2) the default look for base graphics is kinda ... meh. That being said, the base graphics system offers almost unlimited flexibility, both via function options and via the par
system for modifying layouts and graphic defaults. As Colin Gallespie explains in a recent blog post, you can take a scatterplot that looks, by default, like this:
and with a little extra code, make it look like this:
Find out how in Colin's blog post, linked below.
The Jumping Rivers Blog: Styling Base R Graphics
Hi David, I agree that the basic R graphics with R are pretty boring. When we add additional code the the basics, we are allowed to create some pretty good looking graphs with some better graphics than what we can create with ggplot2.
Posted by: Brandon Hansen | February 16, 2018 at 16:51
One way to look at base graphics versus grid graphics is that the information in base graphics is in the code that calls the various functions. Because of this modular design, you can add and subtract almost any graphic element. The downside is that you have to manage the layers and scaling yourself, but that means that you don't have to fight with functions that think they know what you want to do.
Posted by: Jim Lemon | March 14, 2018 at 15:09