plotlayout

plotlayout - R plot layout # make some data....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
R plot layout # make some data. cars<-c(1,3,6,4,9) Default Plotting # Graph the cars vector with all defaults plot(cars) Line instead of Points # Graph cars using blue line and add a title plot(cars, type="l", col="blue", main="Autos") Axis labels - ylab & xlab # Add axis labels plot(cars, type="l", col="blue", main="Autos", ylab='Number seen',xlab='Day') Axis label font size # Change the font size of the axis labels plot(cars, type="l", col="blue", main="Autos", ylab='Number seen',xlab='Day', cex.lab=.7) # You can also change the font size of the title and the axis using cex.main and cex.axis Prettier title # Graph cars using blue line #main is left off here so we can make our own pretty title plot(cars, type="l", col="blue") # Create a title with a red, bold, italic font title(main="Autos", col.main="red", font.main=4)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Plot another data set on same plot #add another data vector called trucks trucks <- c(2, 5, 4, 5, 12) #find out the range of both g_range <- range(0, cars, trucks) # Graph autos using y axis that ranges from 0 to max value in the cars or trucks vector. # Right now we're telling it to leave off the axes so we
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 01/16/2011.

Page1 / 4

plotlayout - R plot layout # make some data....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online