[R] Fwd: How to add a new plot in the same graph using add=T at the command plot?

From: Larissa Lucena <larissalucena_at_gmail.com>
Date: Sat, 19 Jun 2010 21:50:59 -0300

Hi,

I had just left the plotting graphs work, due to other works that had to come first. I tried what was suggested, and all the graphs was places in just a image, but each graph overrides the other, even though the x values are different. The scale also was gone.

Any clue?

Thanks again your help!

My code is like this

> jpeg()
> plot(1.5,media_cob_veloc1.5,main="Cenário 600m x 600m - Tempo de Rede
Coberta", xlab="Velocidade dos Robôs (em m/s)",ylab="Tempo de Rede Coberta (%)", axes=FALSE)

> axis(1,at=seq(0,4.5,by=0.5),pos=0)
> axis(2,at=seq(0,100,by=1.0),pos=0)
> arrows(1.5, media_cob_veloc1.5, 1.5, ic_esq_cob_veloc1.5, length=0.1,
angle=90, code=3)
> arrows(1.5, media_cob_veloc1.5, 1.5, ic_dir_cob_veloc1.5, length=0.1,
angle=90, code=3)
> par(new=T)

> plot(2.5,media_cob_veloc2.5,main="Cenário 600m x 600m - Tempo de Rede
Coberta", xlab="Velocidade dos Robôs (em m/s)",ylab="Tempo de Rede Coberta (%)", axes=FALSE)

> axis(1,at=seq(0,4.5,by=0.5),pos=0)
> axis(2,at=seq(0,100,by=1.0),pos=0)
> arrows(2.5, media_cob_veloc2.5, 2.5, ic_esq_cob_veloc2.5, length=0.1,
angle=90, code=3)
> arrows(2.5, media_cob_veloc2.5, 2.5, ic_dir_cob_veloc2.5, length=0.1,
angle=90, code=3)
> par(new=T)

> plot(4.0,media_cob_veloc4.0,main="Cenário 600m x 600m - Tempo de Rede
Coberta", xlab="Velocidade dos Robôs (em m/s)",ylab="Tempo de Rede Coberta (%)", axes=FALSE)

> axis(1,at=seq(0,4.5,by=0.5),pos=0)
> axis(2,at=seq(0,100,by=1.0),pos=0)
> arrows(4.0, media_cob_veloc4.0, 4.0, ic_esq_cob_veloc4.0, length=0.1,
angle=90, code=3)
> arrows(4.0, media_cob_veloc4.0, 4.0, ic_dir_cob_veloc4.0, length=0.1,
angle=90, code=3)
> dev.off()

2010/6/9 Petr PIKAL <petr.pikal_at_precheza.cz>

> Hi
>
>
> where did you find parameter add=T.
>
> You can use
>
> par(new=T)
> before using new plot command
>
> or use
>
> points, lines
>
> Regards
> Petr
>
> r-help-bounces_at_r-project.org napsal dne 09.06.2010 16:42:25:
>
> > I forgot to show my code... it is like this
> >
> > jpeg()
> > > plot(x,y,main="str", xlab="str",ylab="str", axes=FALSE)
> > > axis(1,at=seq(0,4.5,by=0.5),pos=0)
> > > axis(2,at=seq(0,100,by=1.0),pos=0)
> > > arrows(x, y, x, ic_esq, length=0.1, angle=90, code=3)
> > > arrows(x, y, x, ic_dir, length=0.1, angle=90, code=3)
> > > plot(x1,y1, add=T)
> > Warning messages:
> > 1: In plot.window(...) : "add" năo é um parâmetro gráfico
> > 2: In plot.xy(xy, type, ...) : "add" năo é um parâmetro gráfico
> > 3: In axis(side = side, at = at, labels = labels, ...) :
> > "add" năo é um parâmetro gráfico
> > 4: In axis(side = side, at = at, labels = labels, ...) :
> > "add" năo é um parâmetro gráfico
> > 5: In box(...) : "add" năo é um parâmetro gráfico
> > 6: In title(...) : "add" năo é um parâmetro gráfico
> >
> > Thanks
> >
> >
> > On Wed, Jun 9, 2010 at 11:29, Larissa Lucena
> <larissalucena_at_gmail.com>wrote:
> >
> > > Hi, there!
> > >
> > > I'm having kind this same problem
> > >
> > > https://stat.ethz.ch/pipermail/r-help/2008-October/178221.html
> > >
> > > but I want to display another plot of my data, which is a point with
> two
> > > arrows indicating confidence interval, in the same graph that I've
> just
> > > plotted another, but the "add=T" is not functioning, I'm getting the
> same
> > > error
> > >
> > > Warning messages:
> > > 1: In plot.window(...) : "add" năo é um parâmetro gráfico
> > > 2: In plot.xy(xy, type, ...) : "add" năo é um parâmetro gráfico
> > > 3: In axis(side = side, at = at, labels = labels, ...) :
> > > "add" năo é um parâmetro gráfico
> > > 4: In axis(side = side, at = at, labels = labels, ...) :
> > > "add" năo é um parâmetro gráfico
> > > 5: In box(...) : "add" năo é um parâmetro gráfico
> > > 6: In title(...) : "add" năo é um parâmetro gráfico
> > >
> > > In all tutorials I search, I see that the form of doing that is using
> the
> > > add=T... Is there another way?
> > >
> > > Thanks in advance!
> > >
> > > --
> > > Larissa
> > >
> >
> >
> >
> > --
> > Larissa
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help_at_r-project.org mailing list
> >
https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
Larissa



-- 
Larissa

	[[alternative HTML version deleted]]


______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Sun 20 Jun 2010 - 00:54:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 20 Jun 2010 - 02:00:34 GMT.

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

list of date sections of archive