I have a bar chart (I used ggplot2, geom_bar), but the labels for x-axis are too long and overlap. I would like to keep them as long as they are, but I also would like them to be horizontally (not vertically, nor with an angle). Is there some way to wrap the long labels over multiple (at least two) rows?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I am not aware of a way through ggplot
directly. However you can do something like this:
ggplot(data.frame(x=1:10, y=1:10), aes(x,y)) +
geom_point() +
labs(x='really long label \n with a return')
With your axis labels to make them wrap at a length you choose.