Spacing between labels and axis title

6,210 views
Skip to first unread message

thomas

unread,
Feb 16, 2011, 2:56:41 PM2/16/11
to ggplot2
Hi,

why is the spacing between the labels and the axis title so tiny? If
you look at the figure, "Method" and "fobr" are almost overlapping.
Is this on purpose?
How could one adjust it?

Figure: http://bit.ly/exxmU7 (link to image shack)
Code: http://pastebin.com/WEUwgtKQ

thank you very much,
Thomas

Roy Francis Mathew

unread,
Feb 16, 2011, 3:28:55 PM2/16/11
to ggplot2
I have a same question. The labels are almost always touching the axis title in all my plots.
Is it possible to change it manually? It should be ideally moved a bit away by default in the next version.

Regards
Roy Mathew Francis
royfranc...@agrsci.dk
+45 52809424 (mob)
----------------------------------------
Aarhus University
Department of Integrated Pest Management
Faculty of Agricultural Sciences
Forsøgsvej 1, Slagelse, DK 4200
----------------------------------------
This email may contain information that is confidential.
Any use or publication of this email without written
permission from Faculty of Agricultural Sciences is not
allowed. If you are not the intended recipient, please
notify Faculty of Agricultural Sciences immediately and
delete this email.

--
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


Brandon Hurr

unread,
Feb 16, 2011, 3:54:08 PM2/16/11
to thomas, ggplot2
Actually, I've noticed that the space between my axis titles and axis labels has seemed to lessen in recent plots. I wonder if it's something that's been changed in the newest version. 

Takahashi or Hadley would know probably. 

Does setting the vjust manually change your plot? 


plot + opts(axis.title.x = theme_text(vjust = 0))
Try 0 and 1 to see if it makes a difference, I always get confused which way is which... 

Brandon

Thomas Kern

unread,
Feb 16, 2011, 3:59:43 PM2/16/11
to Brandon Hurr, ggplot2
I thought that there might be an update out, so i updated ggplot to the
most recent version a week ago (version 0.8.9). The update had no effect
though.

Yes, vjust actually works. 0 it is.

Thanks,
Thomas
> ------------------------------------------------------------------------
>
> Brandon Hurr <mailto:brando...@gmail.com>
> 16 February 2011 9:54 PM

Dennis Murphy

unread,
Feb 16, 2011, 5:39:45 PM2/16/11
to Roy Francis Mathew, ggplot2
Hi:

What I've started doing is to insert a line of space before the x-axis label and/or after the y-axis label, as in

labs(x ='\nThis is my x-label', y = 'This is my y-label\n')

It's Q & D, but it works for me at the moment.

HTH,
Dennis
Reply all
Reply to author
Forward
0 new messages