title: ggplot2: negative bar chart with dual x axis
body: <p>I want to produce chart like this:
  <a href="https://i.stack.imgur.com/3h5Ph.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3h5Ph.png" alt="enter image description here" /></a></p>
  <p>I go with this code:</p>
  <pre><code>dat &lt;- data.frame(
    name1 = c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;),
    name2 = c(&quot;F&quot;, &quot;G&quot;, &quot;H&quot;, &quot;I&quot;, &quot;J&quot;),
    value = c(-12,10,5,-7,-2)
  )
  
  ggplot(dat,aes(x = name1,y = value)) +
    geom_bar(stat = &quot;identity&quot;,
             fill = &quot;#465978&quot;,
             width = 0.3) +
    ylim(-50,50) +
    geom_hline(yintercept = 0,
               color = &quot;#9e9e9e&quot;,
               alpha = 0.3,
               linetype = &quot;dotted&quot;) +
    coord_flip() +
    theme_bw() +
    theme(axis.line = element_blank(),
          axis.title = element_blank(),
          axis.text.x = element_blank(),
          axis.text.y = element_text(colour = &quot;#737373&quot;),
          axis.ticks = element_blank(),
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),
          panel.border = element_blank(),
          panel.background = element_blank())
  
  </code></pre>
  <p>and ended up like this: (note: there is a line in the middle, if you can't see, may be due to low resolution)</p>
  <p><a href="https://i.stack.imgur.com/3KN63.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3KN63.png" alt="enter image description here" /></a></p>
  <p>How to add <code>dat$name2</code> in the right side (i.e. top x axis)?</p>
  <p>If you don't mind, maybe you can help me produce more similar chart?</p>