You can in fact pass negative values to vjust (this feels dirty, as
the documentation states that these values must be in the [0, 1]
range, but it works). Passing vjust = -5 works:
ggplot(mtcars, aes(x=hp, y=mpg)) +
geom_point() +
theme(axis.title.x = element_text(vjust=-5))
except that the title is now outside the plotting area, so we also
have to increase the plot.margin:
library(grid)
ggplot(mtcars, aes(x=hp, y=mpg)) +
geom_point() +
theme(axis.title.x = element_text(vjust=-5) ,
plot.margin = (unit(c(.5, .5, 2, .5), "cm")))
HTH,
Ista
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.