I thought I'd raise 2 issues I've encountered with regards to the way
ggplot2 renders main titles and axis titles. The first is an issue I
definitely think is important, the second is debatable.
Here's some code to start us off:
ggplot(mtcars,aes(x=mpg,y=disp,colour=cyl))+
geom_point()+
opts(title='"p" contains a descender')+
labs(
x='"h" contains an ascender'
,y='"q" also contains a descender'
,colour='qlegendq'
)
(pdf attached because I plan to link this thread to a typographer
colleague of mine who might care to contribute but who doesn't know R)
(1) Text centering
It seems that the main title and axis titles are not centered on the
plot frame but by some other system (maybe the frame including the
axis text?). Doesn't a panel-based centering system make more sense?
(2) Text spacing
The text in the main title and axis titles feel a little too tight to
me; the main title is still too close to the plot panel and the axis
titles feel too close to the axis text. I say that this has debatable
importance because you can add newline characters to the titles to
force space (I do this in the "ez" package), but even then you're
limited to integer numbers of newlines and thus can't finely tune the
spacing.
Thoughts?
Mike
--
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University
Looking to arrange a meeting? Check my public calendar:
http://tr.im/mikes_public_calendar
~ Certainty is folly... I think. ~
Agreed - this is something I've wanted to fix for a long time, and
will be done in the big layout rewrite.
> (2) Text spacing
>
> The text in the main title and axis titles feel a little too tight to
> me; the main title is still too close to the plot panel and the axis
> titles feel too close to the axis text. I say that this has debatable
> importance because you can add newline characters to the titles to
> force space (I do this in the "ez" package), but even then you're
> limited to integer numbers of newlines and thus can't finely tune the
> spacing.
I think you're right. One problem I have is ensuring that there is
enough space when you have a title, but not too much when you don't
have a title. Additionally, grid doesn't include descenders when
calculating the height of a string, which makes it hard to look good
for both presence and absence of descenders.
Hadley