在ggplot2中更改轴线样式

时间:2015-04-01 06:15:51

标签: r graphics ggplot2 axis

我想更改我的绘图的轴样式以用于发布目的。请使用ggplot

考虑以下图表
library(ggplot2)
c <- ggplot(mtcars, aes(factor(cyl)))
c + geom_bar() + theme_bw() +
      theme(panel.border = element_blank(),
            axis.line = element_line(colour="black",linetype = 1,lineend = "butt"))

enter image description here

但我想将轴样式更改为此绘图,使用R中的基本图形绘制。 enter image description here

所以,基本上我不希望x轴和y轴连接在一起。应该有一些空间。有可能在ggplot中做吗?谁能帮忙?

注意:我可以直接使用基本图形,但是,在其他图中虽然轴甚至在基本图形中也不是这样的。此外我对ggplot非常熟悉,我使用它的其他功能,如facet,躲避酒吧,颜色酿造等。所以,我想学习如何在ggplot中这样做,以便我可以进一步扩展到我的许多情节

0 个答案:

没有答案