[R] Add arrows to a filled.contour margin

Greg Snow Greg.Snow at imail.org
Mon Aug 11 19:20:53 CEST 2008


The problem is that the coordinate system after the call to filled.contour is not the same as used to create the contour plot.  There are a couple of ways to do what you want.

1. use the plot.axes argument (see the help page and the examples) and have that plot the arrows as part of the call.

2. change the axes at the end, then add the arrows (the updateusr function in the TeachingDemos package may help here).

If you want the arrows to show up in the margins of the plot, then also look at ?par and scroll down to the section on 'xpd'.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111



> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Ronaldo Reis Junior
> Sent: Tuesday, August 05, 2008 7:55 AM
> To: R-Help
> Subject: [R] Add arrows to a filled.contour margin
>
> Hi,
>
> I try to put an arrow to a filled.contour plot. I make this:
>
> filled.contour(volcano, color = terrain.colors,key.axes=F)
> arrows(0.95,0,0.95,1,lwd=2)
>
> This work, but the problem is that I find the coordinates at
> random try, for other graphic with other scale is other fight
> with coordinates. Anybody know a more easy  or more
> generalized way to make this? Somethink like this
> mtext(arrows(),side=4).
>
> Thanks
> Ronaldo
> --
> The sweeter the apple, the blacker the core -- Scratch a
> lover and find a foe!
>                 -- Dorothy Parker, "Ballad of a Great Weariness"
> --
> > Prof. Ronaldo Reis Júnior
> |  .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Biologia
> Computacional
> | : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia `.
> | `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
> |   `- Fone: (38) 3229-8187 | ronaldo.reis at unimontes.br |
> | chrysopa at gmail.com http://www.ppgcb.unimontes.br/lbc |
> ICQ#: 5692561 |
> | LinuxUser#: 205366
> --
> Favor NÃO ENVIAR arquivos do Word ou Powerpoint Prefira
> enviar em PDF, Texto, OpenOffice (ODF), HTML, or RTF.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list