title: How to order the months chronologically in plotly?
body: <p><a href="https://i.stack.imgur.com/fAF1E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fAF1E.png" alt="enter image description here" /></a></p>
  <p>As everyone can see on the X-axis, the order of months are random however I want to order the months chronologically from January to December. Thank you for the answers!!</p>
  <pre><code>**#Counting the number of guests in both resort and city hotels**
  
  Resort_Guests_Monhtly = Rh.groupby(&quot;arrival_date_month&quot;)[&quot;hotel&quot;].count()
  City_Guests_Monthly = Ch.groupby(&quot;arrival_date_month&quot;)[&quot;hotel&quot;].count()
  
  Resort_Guests_data = pd.DataFrame({&quot;month&quot;:list(Resort_Guests_Monhtly.index), 
                                 &quot;hotel&quot;:&quot;Resort hotel&quot;,
                                 &quot;guests&quot;:list(Resort_Guests_Monhtly.values)})
  
  City_Guests_data = pd.DataFrame({&quot;month&quot;:list(City_Guests_Monthly.index), 
                                 &quot;hotel&quot;:&quot;City Hotel&quot;,
                                 &quot;guests&quot;:list(City_Guests_Monthly.values)}) function
  
  **#Concenate the city and resort hotel data** 
  
  all_guests_data =pd.concat([Resort_Guests_data,City_Guests_data],ignore_index=True)
  
  **#Trying to order the months but didn't work** 
  
  ordered_months = [&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, 
        &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;]
  all_guests_data['month'] = pd.Categorical(all_guests_data['month'], categories=ordered_months, ordered=True)
  
  
   **#Visulization**
  
  fig = px.line(all_guests_data, x=&quot;month&quot; , y=&quot;guests&quot;,title=&quot;Average number of hotel guests per month&quot;, color='hotel')
  fig.show()
  </code></pre>