Visualizing Stock Return of a Company Over Time with Barplots

Coloring Barplots Based on Sign: Stock Return

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

Adding and Troubleshooting Text Annotations on a plot with ggplot2

Illustrating Text Annotation Troubles

Adding text annotations to a plot can greatly help understanding a plot better. In this tutorial, we will learn couple of examples of adding text annotations to a scatter plot with three groups of samples. First we see couple of examples of what might typically go wrong while trying to add annotations with ggplot2. And… Continue reading Adding and Troubleshooting Text Annotations on a plot with ggplot2

Visualizing Stock Price of a Single Company Over Time

Month Name and Year with scale_x_date in ggplot2

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

How to Color Barplots with R Color Brewer

Color barplot with RColorBrewer palette

In this tutorial we will learn to how to color bars in a barplot using R Color Brewer’s color palettes. R Color Brewer package “RColorBrewer” offers numerous color palettes that are useful in common situations. For example, it gives “Sequential” palette for ordered data, “Diverging” palette for highlighting deviations from baseline and “Qualitative” palette for… Continue reading How to Color Barplots with R Color Brewer

How to Highlight Groups with Convex Hull in ggplot2

Highlighting Groups in a ggplot with Convex Hull in R

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

Exit mobile version