2

I want to change the axis style of my plot for publication purpose. Consider the following plot using 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

But I want to change the axis style into something like this plot, plotted using base graphics in R. enter image description here

So, basically I dont want x-axis and y-axis to join together. There should be some space. Is it possible to do in ggplot? Can anyone help ??

Note:I can directly use base graphics but, in other plots though axes are not like this even in base graphics. Moreover I am very comfortable with ggplot and I use other features of it like, facets,dodging bars,colour brewer etc.. So, i wanted to learn how to do this in ggplot so that i can further extend that to many of my plots.

Koundy
  • 5,265
  • 3
  • 24
  • 37
  • 2
    Why would you want to look exactly like base graphics? If you want to look like that, why not just use base graphics in the first place? – David Robinson Apr 01 '15 at 06:17
  • 1
    I liked this axis style in base graphics histogram. In other plots though axes are not like this even in base graphics. Moreover I am very comfortable with ggplot and I use other features of it like, facets,colour brewer etc.. So, i wanted to learn how to do this in ggplot so that i can further extend that to many of my plots. – Koundy Apr 01 '15 at 06:27

0 Answers0