A fresh look for base graphics

February 15, 2018

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

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

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)