[R] How to access the attributes of a ggplot?

From: Tribo Laboy <tribolaboy_at_gmail.com>
Date: Fri, 04 Apr 2008 23:58:07 +0000


I am having some hard time figuring how to access (and modify) the properties of an object created by ggplot.

I found 'ggopts', but it only returns some of the properties. Say I want to get the x- and y-axis limits, the tickmark locations, legend current position, the legend box and background color and set them to new values.

Are these properties easily accessible (and modifiable) from the object?

Here is an example

pobj <- ggplot(data = movies[1:300,], aes(x = year, y = length, size = rating)) + geom_point() + opts(legend.position = c(0.2,0.9))



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. Received on Sat 05 Apr 2008 - 00:01:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Apr 2008 - 20:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive