title: direction of bars in ggplot barplot with log scale axes
body: <p>I'm trying to create a bar plot of multiple data that has a log10 y-axis with nonzero values less than 1 like the image below (created in graphpad) based on the following data (dataframe = df): </p>
  
  <pre><code>No  Perc    Codon
  1   72   ATA
  2   12.7273  ATG
  3   8.72727  GTG
  4   0.727273     ATG
  5   0.363636     GTG
  6   0.363636     GTG
  7   0.363636     GTG
  8   0.363636     GTG
  9   0.363636     GTG
  10  0.363636     ATA
  11  0.363636     ATA
  12  0.363636     ATA
  13  0.363636     ATA
  14  0.363636     ATA
  15  0.363636     ATA
  16  0.363636     ATG
  17  0.363636     ATG
  18  0.363636     ATG
  19  0.363636     ATG
  20  0.363636     ATG
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/svOG4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/svOG4.png" alt="graphpad image"></a></p>
  
  <p>Using ggplot for the following data, I'm trying to create something similar based on other information from other questions to address my issues (to no avail). </p>
  
  <pre><code>ggplot(data=df,aes(x=No, y=Perc, color=Codon)) + geom_bar(stat="identity") + scale_y_log10( breaks=c(0.1, 1, 10, 100), limits=c(0.1, 100), position = "top") + coord_flip() + geom_segment( aes(x=No, xend=No, y=0.01, yend=Perc))
  </code></pre>
  
  <p>which produces the following image: </p>
  
  <p><a href="https://i.stack.imgur.com/d26JD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d26JD.jpg" alt="ggplot image"></a></p>
  
  <p>However, I would like the bar to continue in the same direction despite being less than 1. Moreover, is there a way that I can reposition the x-axis to the top of the graph and reorder the data such that the largest values are on the top as in the graphpad generated image? </p>
  
  <p>I know that other similar <a href="https://stackoverflow.com/questions/47932452/trouble-with-log-scale-on-ggplot-grouped-bar-plot">questions</a> have described simialr issues with the direction of the bars, but without solution. </p>
  
  <p>Any help or advice for this novice would be much appreciated.
  Thanks!</p>