[R] Editing R graphics (fwd)

Prof Brian D Ripley ripley at stats.ox.ac.uk
Mon Nov 26 16:51:32 CET 2001


On Mon, 26 Nov 2001, Emmanuel Paradis wrote:

> At 11:04 26/11/01 +0100, Agustin Lobo <alobo at ija.csic.es> wrote:
>
> [...]
>
> >On Fri, 23 Nov 2001, Paul Murrell wrote:
> >
> >> I would be very interested to know the sorts of things you do to add things
> >> interactively to plots.
> >>
> >> As one reply mentioned, there is quite a lot of flexibility in R's graphics
> >> for placing additional text and graphical objects using functions like
> >> text(), rect(), lines(), polygon(), ...  This can even be done with a small
> >> interactive element using locator().  For example, ...
> >>
> >>     plot(1:10)
> >>     text(locator(1), "some annotation")
> >>     # now click on the graph where you want it to go
> >>
> >> However, there are things which are not possible (like selecting a piece of
> >> text on a graph and moving it with the mouse).
> >>
> >> Some of the work I am doing in the graphics at the moment, and in the new
> >> graphics package grid, will allow *some* more interactivity (or at least
> >> provide the possibility to develop it), so it would be great to know what
> >> sorts of things people really would like to be able to do.
> >>
> >> Any information gratefully received :)
>
> [...]
>
> >Sometimes I also include another (reduced) figure, for
> >example
> >a reduced map indicating the geographic location of some sites, and or
> >time-series of the phenology as shown by satellite imagery. Another
> >example of adding ancillary information to an statistic graphic is
> >adding field-collected information to a graphic that displays results
> >from the analysis od remotely-sensed imagery.
>
> Would it be possible to have a low-level plotting command that includes in
> a graph a picture read from the disk? That would be device-dependent I
> guess, something like
>
> postscript(file="figure1.ps")
> plot(x, y)
> include("C:/data/picts/map.ps", location=..., width=..., height=...)
> dev.off()
>
> would make a PostScript file with a bivariate plot that includes a map.
>
> This is just a suggestion, and I do not know how difficult it could be.

Potentially very difficult.  Including EPS files into postscript might
work quite easily, but verifying that it is EPS you included is not.
Including general PostScript could be disastrous.  So it depends how safe
one wants this to be.

Including .PDF into pdf or .fig into xfig is a lot harder, AFAIK.

We have talked about allowing the inclusion of bitmapped images, which
have lots of potential usages.  Again, hard to do in general across all
devices, but potentially very worthwhile.

-- 
Brian D. Ripley,                  ripley at 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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list