labeling x-axis vertically

8 views
Skip to first unread message

Vimal B

unread,
Sep 28, 2009, 3:22:33 PM9/28/09
to ggplot2
Hi,

I have a bar plot where the x-axis contains names of countries. I've been trying to rotate the labeling of each bar to 90 degrees so that they are labelled vertically and not achieved it. Any suggestions on how to do it? I tried using the space="free" option in the facet_grid() option for the graph and it only helped in spacing out the labels and nothing more.

Here is the graph code:-

print(ggplot(data=regqual.comp,aes(x=country,y=estimate))+geom_bar(stat="identity",position="dodge",fill="black")+labs(x=NULL,y="Regulatory Quality")+facet_grid(year~.,scales="free",space="free"))

Thanks in advance!

Regards,
Vimal

smu

unread,
Sep 28, 2009, 3:32:55 PM9/28/09
to Vimal B, ggplot2
Hi,

I guess you are searching for
+ opts(axis.text.x = theme_text(angle = 75)

regards,
Stefan

Vimal B

unread,
Sep 28, 2009, 3:37:44 PM9/28/09
to smu, ggplot2
Ah! Thanks.

Regards,
Vimal

Mobile: +91-9818298975
Email: vim...@gmail.com
Blog: http://vimsaa.blogspot.com



2009/9/29 smu <s...@z107.de>
Reply all
Reply to author
Forward
0 new messages