[R] R 1.1 congrat; undocumented behaviour of recordPlot

Kaspar Pflugshaupt pflugshaupt at geobot.umnw.ethz.ch
Thu Jun 22 16:18:51 CEST 2000


first, I'd like to congratulate the core team to the new R version 1.1. I
think it's a great update, with glimpses into an even greater future

While playing around with the new functions (on Win 95), I found the

As the documentation states, when I generate a plot and save it with
recordPlot, I can regenerate it by printing the variable:

> plot(1:10)
> abline(h=5)
> abline(v=5)
> t.plot<-recordPlot()
> t.plot

works perfectly.

Now, if I add further elements to this (regenerated) plot, they get drawn
all right (I tested only abline()), which surprised me . But when I re-save
the result, only the new additions get saved:

> abline(h=9)     # works (to my surprise)
> t.plot2<-recordPlot # saves only the addition, as can be seen by:
> str(t.plot2)

OK, so I thought I might regenerate the combined plot by

> t.plot   # worked
> t.plot2 # cleared graph, but did nothing

I think it would be useful to be able to save and replay additions to a plot
as well as complete plots. One might, for example, try out several additions
to a basic plot (different kinds of regression lines, to give an example)
and save the final version with the plot to move on and try out several
legend placements etc., thus building up the final graph in several steps.

So it would be nice if either recordPlot could "update" a saved plot with
new additions or if replayPlot could reproduce additions on another plot.

Just a suggestion (I hope I made myself clear).



Kaspar Pflugshaupt
Geobotanisches Institut
Zuerichbergstr. 38
CH-8044 Zuerich

Tel. ++41 1 632 43 19
Fax  ++41 1 632 12 15

mailto:pflugshaupt at geobot.umnw.ethz.ch
privat:pflugshaupt at mails.ch

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