title: seaborn in Python : barplot appears upside down
body: <p>I am learning seaborn and I am getting some unexpected behavior.</p>
  
  <p>This reproducible example uses the surveys.csv dataset that can be found in this link: <a href="http://www.datacarpentry.org/python-ecology-lesson/setup/" rel="nofollow noreferrer">http://www.datacarpentry.org/python-ecology-lesson/setup/</a></p>
  
  <p>My code is the following:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import matplotlib as mpl
  import matplotlib.pyplot as plt
  import seaborn as sns
  sns.set(style="whitegrid", color_codes=True)
  
  surveys_df = pd.read_csv("surveys.csv")
  avg_weight = surveys_df.groupby("plot_id")["weight"].mean().to_frame()
  avg_weight
      weight
  plot_id 
  1   51.822911
  2   52.251688
  3   32.654386
  4   47.928189
  5   40.947802
  6   36.738893
  7   20.663009
  8   47.758001
  9   51.432358
  10  18.541219
  11  43.451757
  12  49.496169
  13  40.445660
  14  46.277199
  15  27.042578
  16  24.585417
  17  47.889593
  18  40.005922
  19  21.105166
  20  48.665303
  21  24.627794
  22  54.146379
  23  19.634146
  24  43.679167
  
  sns.barplot(x = avg_weight.index.values, y = "weight", 
              data = avg_weight, palette = sns.palplot(sns.diverging_palette(150, 275, s=80, l=55, n=9)))
  plt.xlabel('Animal id')
  plt.ylabel('Average Weight')
  plt.title('Average Weight by Animal')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zJ2GQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zJ2GQ.png" alt="enter image description here"></a></p>
  
  <p>The barplot appears upside down.</p>
  
  <p>Why this happens and how can I correct it?</p>
  
  <p>Your advice will be appreciated.</p>
  
  <p>PS: Somehow this problem relates to the value passed to the palette argument, as it was resolved when I chose <code>palette = sns.color_palette("coolwarm", 7)</code>. Still, I can not understand why.</p>