title: Datapoints ordering: catplot seaborn
body: <ul>
  <li><p>In the <em>df</em> all the color types are together after sorting, however, in the first plot Y1 is between Xs (see below).</p>
  </li>
  <li><p>By adding the <em>col=</em> to build a grid, the order is even further broken up.</p>
  </li>
  <li><p>How can you keep the color <em>types</em> together on the plot?</p>
  </li>
  <li><p>I've tried <em>hue_order</em>, <em>order</em>, <em>col_order</em> without any success.</p>
  </li>
  <li><p>Plot 1: need the orange X color types to be in order X3 &gt; X2 &gt; X1, not X3 &gt; X2 &gt; Y1 &gt; X1</p>
  </li>
  <li><p>Plot 2: need all the color types to be in order (one after another)</p>
  </li>
  </ul>
  <p>Thank you in advance!</p>
  <p><strong>color_data.csv</strong> = <a href="https://i.stack.imgur.com/Ztv9w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ztv9w.png" alt="enter image description here" /></a></p>
  <p><strong>color_data.csv</strong>:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>YEAR</th>
  <th>SITE</th>
  <th>G_annoation</th>
  <th>color</th>
  <th>Type</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2018</td>
  <td>Alpha</td>
  <td>Y1</td>
  <td>Y</td>
  <td>A</td>
  </tr>
  <tr>
  <td>2017</td>
  <td>Alpha</td>
  <td>X1</td>
  <td>X</td>
  <td>A</td>
  </tr>
  <tr>
  <td>2016</td>
  <td>Alpha</td>
  <td>X2</td>
  <td>X</td>
  <td>B</td>
  </tr>
  <tr>
  <td>2018</td>
  <td>Alpha</td>
  <td>X3</td>
  <td>X</td>
  <td>B</td>
  </tr>
  <tr>
  <td>2017</td>
  <td>Alpha</td>
  <td>Z1</td>
  <td>Z</td>
  <td>B</td>
  </tr>
  <tr>
  <td>2017</td>
  <td>Alpha</td>
  <td>T1</td>
  <td>T</td>
  <td>A</td>
  </tr>
  <tr>
  <td>2018</td>
  <td>Alpha</td>
  <td>T2</td>
  <td>T</td>
  <td>A</td>
  </tr>
  <tr>
  <td>2016</td>
  <td>Alpha</td>
  <td>T3</td>
  <td>T</td>
  <td>A</td>
  </tr>
  </tbody>
  </table>
  </div>
  <pre><code>  df = pd.read_csv('color_data.csv') 
    g= sns.catplot(data=df.sort_values(by='color'),
             x=&quot;Type&quot;, y=&quot;G_annotation&quot;, hue=&quot;color&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/LitaA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LitaA.png" alt="enter image description here" /></a></p>
  <pre><code>  df = pd.read_csv('color_data.csv') 
    g= sns.catplot(data=df.sort_values(by='color'),
             x=&quot;Type&quot;, y=&quot;G_annotation&quot;, hue=&quot;color&quot;, col=&quot;YEAR&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/V5RGk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V5RGk.png" alt="enter image description here" /></a></p>