rotate x-axis labels, theme_bw

2,050 views
Skip to first unread message

Johannes Radinger

unread,
Sep 8, 2011, 6:38:53 AM9/8/11
to ggplot2
Hello,

I want to rotate my x-axis labels in my boxplot-plot.
I found some lines in the internet like:
opts(axis.text.x=theme_text(angle=90))
but as I want to use the predefined black&white theme (theme_bw), I
don't know how to do it.

What I have so far:

ggplot(data.p, aes(x=p.family,y=p.share))+
geom_boxplot()+
scale_y_continuous("Y Axis")+
scale_x_discrete("X Axis")+
opts(axis.text.x=theme_text(angle=90))
#theme_bw()

But I can use here either the theme_bw without rotating or the standard theme with rotating.

What do I have to set?

/johannes
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone

Luciano Selzer

unread,
Sep 8, 2011, 8:01:18 AM9/8/11
to Johannes Radinger, ggplot2
Johannes, just change the order of the calls. opts() should be last, that way you avoid theme_* reseting it. 
Luciano


2011/9/8 Johannes Radinger <JRad...@gmx.at>

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

Johannes Radinger

unread,
Sep 8, 2011, 8:46:31 AM9/8/11
to Luciano Selzer, ggp...@googlegroups.com
Thank you very much Luciano, works perfectly!

/johannes

-------- Original-Nachricht --------
> Datum: Thu, 8 Sep 2011 09:01:18 -0300
> Von: Luciano Selzer <luciano...@gmail.com>
> An: Johannes Radinger <JRad...@gmx.at>
> CC: ggplot2 <ggp...@googlegroups.com>
> Betreff: Re: rotate x-axis labels, theme_bw

Reply all
Reply to author
Forward
0 new messages