title: How to sort Plotly bar chart in descending order
body: <p>I have created a basic bar chart in plotly that I would like to sort by descending order.
  <a href="https://i.stack.imgur.com/Bx5f3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bx5f3.png" alt="enter image description here" /></a></p>
  <p>I couldn't find an easy way to specify this in the plotly syntax, so I tried modifying the dataframe with Pandas. This also hasn't worked.</p>
  <p>My code is below:</p>
  <pre><code>import plotly.plotly as py
  import plotly.graph_objs as go
  import pandas as pd
  
  
  df = pd.read_csv('C:/Users/Documents/Python/CKANMay.csv')
  sd = df.nlargest(3,'Views')
  fd = sd.sort_values(by='Views', ascending = False)
  
  
  my_data = [go.Bar( x = fd.Views, y = fd.Publisher, orientation = 'h')]
  my_layout = ({&quot;title&quot;: &quot;Most popular publishers&quot;,
                         &quot;yaxis&quot;: {&quot;title&quot;:&quot;Publisher&quot;},
                         &quot;xaxis&quot;: {&quot;title&quot;:&quot;Views&quot;},
                         &quot;showlegend&quot;: False})
  
  fig = go.Figure(data = my_data, layout = my_layout)
  
  py.iplot(fig)
  </code></pre>
  <p>I would like to invert the bar chart, so that the column with the greatest value is on the top. Appreciative for any assistance.</p>