title: Display X Axis at Top of Plotly Plot in R Shiny Instead of Bottom?
body: <p>How do I display the x axis at the top of a Plotly horizontal bar plot instead of at the bottom? Showing the x axis at both the top and bottom would also be ok. The plot will be displayed in R Shiny and must be Plotly not ggplotly. Thanks!</p>
  
  <p>Example from <a href="https://plot.ly/r/horizontal-bar-charts/" rel="nofollow noreferrer">https://plot.ly/r/horizontal-bar-charts/</a>:</p>
  
  <pre><code>library(plotly)
  plot_ly(x = c(20, 14, 23), 
  y = c('giraffes', 'orangutans', 'monkeys'), 
  type = 'bar', 
  orientation = 'h')
  </code></pre>
  
  <p>EDIT: HubertL provided a solution (thanks!) that puts the x axis at the top but it then overlaps with the chart title. My fault for not specifying that I am using a title. Is there a way to get the x axis title and x axis ticks to not overlap the plot title?</p>
  
  <pre><code>plot_ly(x = c(20, 14, 23), 
          y = c('giraffes', 'orangutans', 'monkeys'), 
          type = 'bar', 
          orientation = 'h') %&gt;%
     layout(xaxis = list(side ="top", 
            title = "EXAMPLE X AXIS TITLE"), 
            title = "EXAMPLE PLOT TITLE")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/oyKYo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oyKYo.jpg" alt="enter image description here"></a></p>