[R] RE: Adding a line in the graph of 'plot()'

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Mon Nov 29 03:02:29 CET 2004


The general nature of your question means there are a multitude of answers.

if you type '?abline' it will give you an example of a line drawn over a plot.

type ?segments, ?lines, ?points, ?text and go through the examples and try them out

The help pages to the base package 'grid' includes an introduction to using the various drawing mechanisms

see ?par for the 'new' argument

logical, defaulting to 'FALSE'.  If set to 'TRUE', the next
high-level plotting command (actually 'plot.new') should _not
clean_ the frame before drawing "as if it was on a *_new_*
device".

Alternatively the 'lattice' package can produce a wide range of plots.

Then try the various contributed documents that exist on the CRAN mirrors to further your knowledge. It's all there. 

Tom Mulholland

-----Original Message-----
From: dvrecko at sfu.ca [mailto:dvrecko at sfu.ca]
Sent: Monday, 29 November 2004 9:35 AM
To: r-help at stat.math.ethz.ch
Subject: [R]: Adding a line in the graph of 'plot()'


Hello.

I'm looking for a way to add a line in a plot of a points that should lie
along a particular line. Can I add a line to the 'plot()' function, maybe
using 'abline()' so that the line is visible in the graph of 'plot()'? How?
More generally, can I overlay plots over one another?

Thanks.

Dean Vrecko
Simon Fraser University

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list