In this tutorial, we will learn how to visualize a company’s stock price over time. Stock data is an example of time series data, where we have stock price of a company for a period of time. First, we will learn how to get stock price for a company of interest and use ggplot2 to… Continue reading Visualizing Stock Price of a Single Company Over Time
Category: ggplot2
How to Highlight Groups with Convex Hull in ggplot2
In this tutorial, we will learn how to annotate or add colors to multiple groups in a scatter plot made with ggplot2 in R using convex hull shapes. Convex hull is basically a box or polygon connecting the outermost data points for each group in a scatter plot with multiple groups.Adding such convex hulls around… Continue reading How to Highlight Groups with Convex Hull in ggplot2
How to Center Plot Title in ggplot2
In this tutorial, we will learn one of the most basic and useful tip to place the title (and subtitle) of a plot to center using ggplot2. When we add title to a plot made with ggplot2, it places the title left aligned to the plot by default. Sometimes you might want to place the… Continue reading How to Center Plot Title in ggplot2
Side by side plots with ggplot2 using gridExtra
In this tutorial, we will learn how to place two plots made with ggplot2 side by side. In R, we have multiple solutions to combine plots into a single plot. Here, we will use R Package gridExtra’s function grid.arrange to combine two plots side by side. Firs, let us load the packages needed and palmer… Continue reading Side by side plots with ggplot2 using gridExtra
How to Make Axis Title Bold Font with ggplot2
In this tutorial, we will learn how to change the axis title bold font with ggplot2 in R. Let us load the packages needed including tidyverse and palmerpenguins for penguins data. A plot with default font for axis title text Let us make a simple scatter plot using ggplot2 to see how the default font… Continue reading How to Make Axis Title Bold Font with ggplot2