Hi
The main problem here is that you really shouldn't be poking around inside a "recordedplot" object. From the help page:
WARNING:
The format of recorded plots may change between R versions.
Recorded plots should *not* be used as a permanent storage format
for R plots. R will always attempt to replay a recorded plot, but if the plot
was recorded with a different R version then bad things may
happen.This could (should) be more explicit. In particular, it might be worth adding a comment from the C source ...
* The graphics engine assumes that it is getting a snapshot * that was created in THE CURRENT R SESSION
... [snapshot == recordedplot]. The basic message is: don't rely on the internal structure of a recordedplot because we can (and have [and will]) change it at any time.
That leaves the problem of how to achieve your "zoom", but I'm not sure exactly what your zoom is doing (just modifying the axis ranges?). Could you (privately) send me screen shots of before and after the zoom? Then I can try to suggest a "correct" way to zoom.
Paul
Jean Coursol wrote:
I want to do a zoom with recordPlot(). I have problems with lists.
(R-2.0.1 patched 2004-11-30 , various linux). I have problems with RecordPlot class structure.
plot(1:10) saveP <- recordPlot() dev.off()
sx <- saveP[[1]][[2]][[2]] saveP[[1]][[2]][[2]] <- sx
Error in "[[<-"(`*tmp*`, 1, value = list(list(
.Primitive("plot.new")), list(.Primitive("plot
.window"), c(1, : incompatible types
typeof(saveP[[1]][[2]][[2]])
[1] "double"
typeof(sx)
[1] "double"
But:
s1 <- saveP[[1]] s1[[2]][[2]] <- c(4,6) saveP[1] <- list(s1) saveP # zoom is OK
Also, I don't understand recursive indexing.
With not modified saveP,
saveP[[c(1,2)]]
[[1]] .Primitive("plot.window")
[[2]] [1] 1 10
[[3]] [1] 1 10
[[4]] [1] ""
[[5]] [1] NA
# OK
saveP[[c(1,2,2)]]
Error: recursive indexing failed at level 2
# why not [1] 1 10 ??
Jean Coursol
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
