--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
I don't think there is a good solution to this problem in the current
situation. Consider the following example,
library(ggplot2)
my.title <- function(...)
function(label, x = 0.5, y = 0.5, ..., vjust = 0.5,
hjust = 0.5, default.units = "npc") {
tg <- textGrob(label, x, y, hjust = hjust, vjust = vjust, ...)
rg <- rectGrob(x=1, width=unit(1, "npc"), just="right",
gp=gpar(col="red", fill="grey95"))
gTree(children=gList(rg, tg))
}
qplot(1, "aaaaaaaaaaaaaaaaa") + opts(axis.title.x = my.title())
What happens (in plot-render.r) is that the plot panel and the x axis
title viewports share the same width in a Grid layout. Unfortunately,
the plot panel has to accommodate for the y axis tick marks and
labels, and there is no way to know their extent in advance.
A better approach, imho, would have all panel annotations in a
separate viewport.
All the best,
baptiste
> More options: http://groups.google.com/group/ggplot2
>