Jump to content

File:R-basic cars plot example.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikibooks, open books for an open world

Original file (SVG file, nominally 360 × 360 pixels, file size: 109 KB)

Summary

Description
English: A simple graph to illustrate basic plotting routines in R (plot, abline, lines, text, title)
Date
Source Own work
Author HYanWong
 
This W3C-unspecified chart was created with R.

using the following commands

svg("R-basic_cars_plot_example.svg", 4,4,8)
plot(cars)
abline(-17.6,3.9, col="red")    #abline() adds a straight line to the plot: 
lines(lowess(cars), col="blue") #lines() adds a sequence of joined-up lines
text(15, 34, "Smoothed (lowess) line", srt=30, col="blue")                    #text() adds text
text(15, 45, "Straight line (slope 3.9, intercept -17.6)", srt=32, col="red") #(srt rotates)
title("1920s car stopping distances (from the 'cars' dataset)")
dev.off()

Licensing

Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

13 January 2009

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:11, 13 January 2009Thumbnail for version as of 16:11, 13 January 2009360 × 360 (109 KB)HYanWong{{Information |Description={{en|1=A simple graph to illustrate basic plotting routines in R (plot, abline, lines, text, title)}} |Source=Own work by uploader |Author=HYanWong |Date=2009/01/13 |Permission= |other_versions= }} {{Created wi