Last active
September 26, 2017 07:18
-
-
Save aravindhebbali/7c0968878e8cf989b669ae80ac32d15a to your computer and use it in GitHub Desktop.
Data Visualization: Title & Axis Labels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# title | |
plot(mtcars$disp, mtcars$mpg, | |
main = 'Displacement vs Miles Per Gallon') | |
# subtitle | |
plot(mtcars$disp, mtcars$mpg, | |
main = 'Displacement vs Miles Per Gallon', | |
sub = 'Mileage is inversely related to Displacement') | |
# axis labels | |
plot(mtcars$disp, mtcars$mpg, | |
main = 'Displacement vs Miles Per Gallon', | |
sub = 'Mileage is inversely related to Displacement', | |
xlab = 'Displacement', ylab = 'Miles Per Gallon') | |
# title() | |
# create scatter plot | |
plot(mtcars$disp, mtcars$mpg) | |
# add title, subtitle and axis labels | |
title(main = 'Displacement vs Miles Per Gallon', | |
sub = 'Mileage is inversely related to Displacement', | |
xlab = 'Displacement', ylab = 'Miles Per Gallon') | |
# create scatter plot without axis labels | |
plot(mtcars$disp, mtcars$mpg, ann = FALSE) | |
# add title, subtitle and axis labels | |
title(main = 'Displacement vs Miles Per Gallon', | |
sub = 'Mileage is inversely related to Displacement', | |
xlab = 'Displacement', ylab = 'Miles Per Gallon') | |
# axis range | |
plot(mtcars$disp, mtcars$mpg, | |
xlim = c(0, 600), ylim = c(0, 50)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment