Continuing the blog post series on how to control theme elements in ggplot2, in this post we will look at how to customize rectangular elements in ggplot2 using element_rect() function. ggplot2’s theme function helps us fully control the “non-data” elements of a plot made with ggplot2. ggplot2’s theme system comes with multiple element_ functions, element_text() […]
ggplot2
How to Write Functions to Make Plots with ggplot2 in R
Okay here is a confession. Often I preach writing functions to simplify life at work. Although I try to follow the “writing functions” mantra decently, there is a grey area where I don’t use functions that much. Any guesses? Often make tonnes of exploratory plots with ggplot2 with tons of repetition of code with slight […]
15 Tips to Customize lines in ggplot2 with element_line()
As part of understanding and fine tuning ggplot2’s theme elements, we will focus on the anatomy of line elements and see 15 tips to control them with ggplot2’s theme system. With ggplot2’s theme system we can control the “non-data” elements of a plot made with ggplot2. ggplot2’s theme system comes with multiple element_ functions, element_text() […]
10 Tips to Customize Text Color, Font, Size in ggplot2 with element_text()
ggplot2’s theme system give us a great control over how the “non-data” elements of a plot should look like. The theme system helps elevate the plot you make by making finer changes and make it easy to look better. ggplot2’s theme system comes with multiple element_ functions, element_text() element_line() element_rect() element_blank() And they help control […]
New Version of Patchwork is Here: Inset a plot inside a plot
A new version of the R package Patchwork is available on CRAN. If you are not familiar with the Patchwork, it is a R package developed by “one and only” Thomas Lin Pedersen and it makes it possible to combine multiple plots made with R either ggplot2 or base R into a single graphics. As […]