title: plot slightly separated in-group bars with ggplot2 geom_bar()
body: <p>Is there a way to have a little separation between each group bars made with grouped <code>bar_plot()</code>? Like having a bigger distance between different groups and small distance inside group bars, but not sticked one another.</p>
  
  <p>Here the whole code:</p>
  
  <pre><code>### my DF generation
  df.bar &lt;- as.data.frame( cbind(
                                  "diagnosis" = rep( names_DX, 2 ) ,
                                  "number" = as.numeric(c(9,18,43,8,34,12,3,7,38,12,8,6)),
                                  "status" = c(1,1,1,1,1,1,0,0,0,0,0,0)
                                  ))
  df.bar$diagnosis &lt;- factor(df.bar$diagnosis,levels(df.bar$diagnosis)[c(1,5,6,2:4)]) #reorder levels for plot
  
  ### plot generation
  p &lt;-    ggplot(data = df.bar, aes(x = diagnosis, y = as.numeric(as.character(number)), fill = factor(status) )) +
              geom_bar(stat = "identity", position=position_dodge())+
              theme_bw()
  </code></pre>
  
  <p>my result:</p>
  
  <p><a href="https://i.stack.imgur.com/MIaCf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MIaCf.png" alt="sticked bars"></a></p>
  
  <p>what I'd like to get (ignore colors difference etc, only for the bars positions):</p>
  
  <p><a href="https://i.stack.imgur.com/itQQH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/itQQH.png" alt="separated bars"></a></p>
  
  <p>Thanks in advance for any help!</p>