How to Draw a Horizon Chart with R
Commonly, line chart is used to show the temporal change of a variable. But, if the value has a large range, it could take a large space for the chart to show the whole change. Horizon chart dissolved the fluctuations in the line charts in several bands and overlap the bands to show the large range of the values in a relative narrow space. It benefit us to compare various variable in a short time.
The data
Either vector data or matrix can be the input of the chart. My original dataset is composed of three columns: mon, frequency, and keyword.
1 | library(lattice) |
Horizon chart
Draw the horizon chart:
1 | # draw horizon plot |
Reference
[1] Horizon Plots
[2] Plotting Horizon Plots
[3] Horizon Plots