ggplot2 Package

The autoplot.zoo() function in the zoo package provides an easy-to-use interface to the very powerful ggplot2 package which provides a plotting system for R based on the grammar of graphics.

> library(ggplot2)
> 
> autoplot.zoo(bmw_2014_xts, main = "BMW OHLC plot with ggplot2") + xlab("")

plot of chunk autoplotzoo1

We see that the scaling on the y axis is not correct. We use the facet_free() function to allow for different scales on the multiple y axis.

> autoplot.zoo(bmw_2014_xts, 
+              main = "BMW OHLC plot with ggplot2",
+              facets = NULL) + xlab("") +  facet_free()

plot of chunk autoplotzoo2