Skip to content

Instantly share code, notes, and snippets.

@mprymek
Created June 19, 2014 13:28
Show Gist options
  • Save mprymek/5f0737eb174666d97291 to your computer and use it in GitHub Desktop.
Save mprymek/5f0737eb174666d97291 to your computer and use it in GitHub Desktop.
# Define 2 vectors
cars <- c(1, 3, 6, 4, 9)
trucks <- c(2, 5, 4, 5, 12)
# Graph cars using a y axis that ranges from 0 to 12
plot(cars, type="o", col="blue", ylim=c(0,12))
# Graph trucks with red dashed line and square points
lines(trucks, type="o", pch=22, lty=2, col="red")
# Create a title with a red, bold/italic font
title(main="Autos", col.main="red", font.main=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment