Change Axis text/position from within Geom

46 views
Skip to first unread message

tom kern

unread,
Jun 18, 2013, 6:43:23 PM6/18/13
to ggplo...@googlegroups.com
Hi,

is there a way to change the axis text/position from within a Geom?

E.g.

GeomCustom <- proto(Geom, {
...change the axis text here...
})



Thank you,
Thomas

baptiste auguie

unread,
Jun 18, 2013, 6:47:12 PM6/18/13
to tom kern, ggplo...@googlegroups.com
geoms only affect what's inside the plot panels; as an example there's an annotation for log tick marks, but they're constrained to stay inside the plot, so not a real axis in ggplot2's framework.

b.


--
You received this message because you are subscribed to the Google Groups "ggplot2-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

tom kern

unread,
Jun 18, 2013, 6:52:16 PM6/18/13
to ggplo...@googlegroups.com, tom kern
Thank you.
How would you go about creating a geom and changing the labels? making an independent function that creates and operates on a newly created empty ggplot(), adding (+) geom_line, geom_area, geom_point and scale_* to it ?

e.g.

tmp = function(data){
data-manipulation
ggplot() + geom_point(data1,...) + geom_point(data2,...) + geom_line(data3,...) + scale_y_continuous(breaks=...)
}

thomas

tom kern

unread,
Jun 19, 2013, 4:18:15 AM6/19/13
to ggplo...@googlegroups.com, tom kern
I just realized the geom function can return a list.

might as well do

geom_custom <- function(.......){
list(GeomCustom$new(.........), scale_y_continuous(............))
Reply all
Reply to author
Forward
0 new messages