{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

plotlayout - R plot layout make some data cars<-c(1,3,6,4,9...

Info icon This 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)
Image of page 1

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

View Full Document Right 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern