In this post we will learn how to make a grouped boxplots with reproducible jittered points. We can make a grouped boxplot with jittered points using position_jitterdodge() function as position argument to geom_point(). Note that using the handy wrapper function geom_jitter() instead of geom_point() with position_jitterdodge() will not give right plot with jittered data. If… Continue reading Grouped Boxplots with reproducible jittered data points
Category: ggplot2
How to make random jittered points reproducible
In this post we will learn how to make a random jitter plots made with ggplot2 reproducible. We have multiple posts on the importance of showing the actual data points while making boxplots/violinplots. One of the ways to avoid overplotting, is to add random jitters on the x-axis to the data points, so they all… Continue reading How to make random jittered points reproducible
Direct Labeling on line plots with geomtextpath
Labeling a plot greatly help understand the gist of a plot easily. ggplot2 offers a number of ways to add text labels to a plot. Often directly adding the labels on a plot instead of having a legend is a better option. The R package, geomtextpath, a ggplot2 extension package offers a nice solution and… Continue reading Direct Labeling on line plots with geomtextpath
Remove Legend Title in ggplot2 (labs, guides, theme)
In this tutorial, you’ll learn four easy ways to remove legend titles in ggplot2 using scale_fill_discrete(), scale_fill_manual(), guides() with guide_legend(), and theme(legend.title = element_blank()). Each method works slightly differently depending on whether your legend comes from fill or color. We’ll start with a barplot example and end with a universal one-line fix that works in… Continue reading Remove Legend Title in ggplot2 (labs, guides, theme)
Visualizing Stock Return of a Company Over Time with Barplots
In this tutorial, we will learn how to visualize a company’s stock return over time. A stock’s return is defined as the capital gains/losses and income from dividend. We will use the adjusted stock price to compute the nominal return using the fantastic tidyquant R package. First, we will download the stock data of a… Continue reading Visualizing Stock Return of a Company Over Time with Barplots
