[R-sig-Fedora] R Scatter plot partially generated in Fedora

Paul Johnson pauljohn32 at gmail.com
Sat Mar 27 19:26:36 CET 2010


Your R install is fine. You plot commands are wrong, though.

Also no need for semicolons at end of lines anymore.

Note your first x axis goes from 12, 16.

then later you try to write points at 10, which are out of bounds.  if
you want to write at 10, re-do your figure.  This code shows 5 points
on graph.

plot(x=c(7,18), y=c(6,14) , type="n", main="Test", xlab="X", ylab="y")

x <- c(12, 14, 16);
y <- c(7, 12, 10);
points(x,y, col="blue")
x2 <- c(10, 15);
y2 <- c(8, 12);
points(x2, y2, col="green");

After it looks good on screen, then wrap in the png commands.


On Fri, Mar 26, 2010 at 2:48 PM, Nara Rama <nara at cloudbiosciences.com> wrote:
> Hi:
>
> I have installed R first time in Linux/Fedora. I used the yum command
> (yum install R). The installation was successful and went without any
> errors. I could also run the following R script without any errors.
> But, the generated scatter plot only has three blue dots added through
> the first plot(...) statement. It does not show the main title,
> x-/y-axes, x-/y-labels, and also the green dots added through
> points(...) statement.
>
> I don't know if this is an installation problem. Please help.
>
> Linux version:
> ===========
>
> Linux domU-12-31-39-03-00-76 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15
> 12:39:36 EST 2008 i686 athlon i386 GNU/Linux
>
> R version:
> ========
>
> Installed Packages
> Name       : R
> Arch       : i386
> Version    : 2.8.0
> Release    : 2.fc8
>
> R Script:
> =======
>
> png(filename="a.png", height=295, width=300,  bg="yellow");
> x <- c(12, 14, 16);
> y <- c(7, 12, 10);
> plot(x, y, col="blue", main="Test", xlab="X", ylab="y");
> x2 <- c(10, 15);
> y2 <- c(8, 12);
> points(x2, y2, col="green");
> dev.off();
>
> Thanks
>
> Nara
>
> _______________________________________________
> R-SIG-Fedora mailing list
> R-SIG-Fedora at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-fedora
>



-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas



More information about the R-SIG-Fedora mailing list