[R] How to access the attributes of a ggplot?
h.wickham at gmail.com
Tue Apr 8 16:24:03 CEST 2008
> Thanks for replying. I know that I can directly modify some of the
> properties of the plot object, but I was more interested in querying
> the current plot properties, something like:
> xlimits <- getggopts(pobj, "x_scale_limits")
> Is there anything like this implemented?
Ah, that's much more tricky. The problem is that many of these values
are not calculated until you actually draw the plot, and then they are
immediately thrown away because of the copy-on-modify semantics that
I'm following (to match the rest of R). You can access some info
about the scales by looking at str(pobj$scales), but most of the
interesting stuff isn't calculated until draw time.
More information about the R-help