Tuesday 7 April 2015

ggplot theme for publication ready Plots



ggplot2 by Hadley is a very good package for data visualization in R. However the default plots made by the package requires some formatting before we can send them for publication. The package called ggthemes was written by Jeffery for this purpose and provides some excellent themes. But I want to try myself and improvise on the this. So, I have written my own theme (ofcourse with the help of in-built functions from ggthemes thanks to Jeffrey). My main problems with the aesthetics of default ggplot are

* Plot background
* Title and axes labels Font and size
* Axes themselves
* Axis ticks
* Colors
* Legend position

So, here I tried to fix each one of them and create my own theme and color palette. This theme will produce plots with bold axes, bold axes labels and legend at the bottom leaving extra space for the plotting area. The color palette is also designed with the help of color brewer using bold and contrasting colors so, one can easily distinguish any two colors. Feel free to comment and enjoy the theme if you like it. Here are some of my example plots. You can get the entire code and more examples from this link or in github