Category Archives: Plotting

Interactive Plotting in R

There are many ways to compare univariate distributions; one of my favorites is violin plots. However, if you are only comparing two distributions, then the best solution is often a scatter plot. To that end, I’ve build some code that … Continue reading

Posted in Data Munging, Plotting, R, R Tip, Visualization | Leave a comment

Plotting in Grids

This is post #12 in a running series about plotting in R. I regularly find myself wanting to show arrays or grids of plots in R. This is straightforward using par and mfrow as long as you want a symmetric, … Continue reading

Posted in Plotting, R, Statistics, Visualization | Tagged , | Leave a comment

Shading Pieces of an R Plot

This is post #11 in a running series about plotting in R. I often want to shade pieces of an R plot, in order to visually draw out some piece, such as weekends or recessions. Let’s look at how to … Continue reading

Posted in Plotting, R, Visualization | Tagged , | Leave a comment

Filled Line Plots / Graphs in R — Part 10 in a Series

This is post #10 in a running series about plotting in R. Otherwise known as filled curves. Say you want to, instead of drawing a single line, draw a filled curve. R’s basic plot doesn’t make the especially easy, though … Continue reading

Posted in Plotting, R, Visualization | 1 Comment

Multiple Y Axes in R Plots — Part 9 in a Series

This is post #09 in a running series about plotting in R. Frequently, you want to plot data that is not at all on the same scale. In R, this is done via plotting a second graph on top of … Continue reading

Posted in Plotting, R, Visualization | Tagged , | 2 Comments

Visualizing and Comparing Distributions — Part 8 of a Series

This is post #08 in a running series about plotting in R. Last time, I talked about visualizing the Uniform, Normal, Exponential, and Poisson Distributions. However, there are more useful methods than just plotting the density and distribution functions. Of … Continue reading

Posted in Plotting, R, Statistics, Visualization | Tagged , | Leave a comment

Multiple Plots and Visualizing Distributions – Part 7 in a Series

This is post #07 in a running series about plotting in R. I was helping a friend plot some interesting distributions this weekend, so I decided to use distributions to demonstrate one of the neater bits of R’s basic plotting … Continue reading

Posted in Plotting, R, Statistics, Visualization | Tagged , | 1 Comment

Labeling Plots – Annotations, Legends, etc — Part 6 in a Series

This is post #06 in a running series about plotting in R. You regularly want to label pieces of a plot in order to point a particular feature out or answer a question that your audience will have. Let’s see … Continue reading

Posted in Plotting, R, Visualization | Tagged , | Leave a comment

Plotting With Custom X Axis Labels in R — Part 5 in a Series

This is post #05 in a running series about plotting in R. There are a variety of ways to control how R creates x and y axis labels for plots. Let’s walk through the typical process of creating good labels … Continue reading

Posted in Data Munging, Plotting, R, Visualization | Tagged , | 1 Comment

Plotting Multiple Series in R — Part 4 in a Series

This is post #04 in a running series about plotting in R. Frequently, you want to simultaneously plot multiple series on the same plot. Let’s try plotting daily observations along with a 30 day moving average. To start, I have … Continue reading

Posted in Data Munging, Plotting, R | Tagged , | 2 Comments