labels

Rotating and spacing axis labels in ggplot2

跟風遠走 提交于 2019-11-26 01:10:37
问题 I have a plot where the x-axis is a factor whose labels are long. While probably not an ideal visualization, for now I\'d like to simply rotate these labels to be vertical. I\'ve figured this part out with the code below, but as you can see, the labels aren\'t totally visible. data(diamonds) diamonds$cut <- paste(\"Super Dee-Duper\",as.character(diamonds$cut)) q <- qplot(cut,carat,data=diamonds,geom=\"boxplot\") q + opts(axis.text.x=theme_text(angle=-90)) 回答1: Change the last line to q +