Skip to content

Instantly share code, notes, and snippets.

@martin0258
Created May 29, 2013 16:19
Show Gist options
  • Save martin0258/5671572 to your computer and use it in GitHub Desktop.
Save martin0258/5671572 to your computer and use it in GitHub Desktop.
Time series plotting
# Plot multiple time series at one time
# Trick 1: use cut to rotate label values of y-axis
# Trick 2: use auto.key=list(space="inside") to make the legend be inside the panel.
ratings <- read.csv("Chinese_Weekday_Drama.csv", fileEncoding="utf-8")
xyplot(ts(ratings),superpose=TRUE,strip=FALSE,cut=1,
ylab="Rating",type="b",lwd=2,main="TV Rating Actual Data",
auto.key=list(space="inside"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment