title: Flip X & Y coordinates for geom_bar
body: <p>Trying to flip both the X &amp; Y axis to be descending as they move away from (0,0).  It seems that coord_flip() &amp; scale_reverse should do the trick, but it seems to flip just one of the group variables and not the other?  It also seems to ignore the "breaks" statement, in that I would like the range of the bottom axis to run from 0 to 3%.</p>
  
  <p><strong>EDIT:</strong> This is what my chart looks like when I run the code:</p>
  
  <p><a href="https://i.stack.imgur.com/UUV5Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UUV5Q.png" alt="My Chart"></a></p>
  
  <p>And this is the look I am trying to replicate:</p>
  
  <p><a href="https://i.stack.imgur.com/KhP05.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KhP05.jpg" alt="Chart to Replicate"></a></p>
  
  <pre><code>library(data.table)
  library(ggplot2)
  library(dplyr)
  
  
  g0 &lt;- data.table(year = rep(c(1790,1800,1810,1820,1830,1840,1850,1860,1870),2),
                   group = c(rep("A",9),rep("B",9)),
                   per = c(0.987,0.983,0.983,0.988,0.992,0.991,0.993,0.992,0,
                           0.013,0.017,0.017,0.012,0.008,0.009,0.007,0.008,1))
  
  ggplot(g0, aes(x=year, y=per, fill=group)) +
    geom_area(alpha = 0.8, size=1) +
    coord_flip() +
    scale_x_reverse(breaks = as.numeric(seq(1790, 1870, by=10))) +
    scale_y_reverse(position = "top", breaks = as.numeric(seq(0, 0.03, by=0.01))) +
    theme_minimal() +
    scale_fill_manual(values=c('#101010', '#CB0432')) +
    theme(plot.title = element_text(hjust = 0.5),
          legend.position = "none",
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank())
  </code></pre>