Re: [Rd] can't plot a line

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 23 Jan 2007 - 16:18:45 GMT

On Tue, 23 Jan 2007, Spencer Graves wrote:

> Consider the following:
>
> plot(0, 0, xlim=c(-10, 10), ylim=c(-50, 50))
> lines(c(0,0), (2*c(-pi, pi))^2)
>
> I see no line in this plot.

I do. You are drawing a line from a point to itself. Try lwd=5 and it will be more visible.

>
> R version 2.4.1 (2006-12-18)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
> [7] "base"
>
> My work around is the following:
>
> pi2.2 <- (2*pi)^2
> lines(c(0, 0), c(-pi2.2, pi2.2))

What is (-1)^2?

> Why won't "lines(c(0,0), (2*c(-pi, pi))^2)" work for me?
> Thanks,
> Spencer Graves
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Jan 24 03:26:59 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 23 Jan 2007 - 18:31:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.