Not having p1, this is not reproducible. Working backwards from some
things you said, I realized the x axis is categorical and contains
strings of different lengths. This likely is important. Here is a
reproducible data set:
set.seed(1234)
DF <- data.frame(x=replicate(20, paste(letters[sample(sample(26,1))],
collapse="")),
y=rnorm(20),
X1=rep(c("a","b"), times=10), hierarchy=rep(c("d","e"), each=10))
p1 <- ggplot(DF, aes(x,y)) + geom_point()
> When I do this, the tick marks for the x-axis are offset from the
> bottom of the x-axis by a different amount for each facet, depending
> on the length of the labels associated with each tick mark. If I set
> angle=0, this does not happen, but my x-axis labels then become
> unreadable.
I do see this with
p1 + facet_grid(X1 ~ hierarchy, space="free", scales="free_x") +
opts(axis.text.x = theme_text(angle=45, size=8, hjust=1))
p1 + facet_grid(X1 ~ hierarchy, space="free", scales="free_x") +
opts(axis.text.x = theme_text(angle=45, size=8, hjust=0))
p1 + facet_grid(X1 ~ hierarchy, space="free", scales="free_x") +
opts(axis.text.x = theme_text(angle=90, size=8, hjust=1))
but not with
p1 + facet_grid(X1 ~ hierarchy, space="free", scales="free_x") +
opts(axis.text.x = theme_text(angle=0, size=8, hjust=1))
as you say. It is also present in the development version.
It is also sensitive to the exact data, since I did not see it when I
ran this same code with set.seed(123). I don't know what causes it, but
I wanted to at least confirm it and give a reproducible example.
> What is particularly bizarre about this behavior is that it only
> happens when I generate this plot using R installed on Linux. Using
> the exact same function on a Mac gives x-axis tick marks/labels that
> are aligned perfectly. I am using v0.8.9.
>
> Any thoughts?
>
> Thanks in advance!
> Miriam
--
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University
Hadley
> --
> 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
>
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
Yes.
> Hadley
>> Oregon Health& Science University
>>
>> --
>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>> To unsubscribe: email ggplot2+unsubscribe-/JYPxA39Uh5...@public.gmane.org
>> More options: http://groups.google.com/group/ggplot2
>>
>
>
>
--