title: Modifying x ticks labels in seaborn
body: <p>I am trying to modify the format of the x-tick label to date format (%m-%d).</p>
  <p>My data consists of hourly data values over a certain period of dates. I am trying to plot the data for 14 days. However when I run I get x labels fully jumbled up.</p>
  <p><a href="https://i.stack.imgur.com/Yv4bH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Yv4bH.png" alt="enter image description here" /></a></p>
  <p>Is there any way I can show only dates and skip hourly values on the x-axis. ? Is there any way to modify x ticks where I can skip labels for hours and show labels only for dates? I am using seaborn.</p>
  <p>After suggestion from comment by i edited my code to plot as below:</p>
  <pre><code>fig, ax = plt.pyplot.subplots()
  g = sns.barplot(data=data_n,x='datetime',y='hourly_return')
  g.xaxis.set_major_formatter(plt.dates.DateFormatter(&quot;%d-%b&quot;))
  </code></pre>
  <p>But I got the following error:</p>
  <pre><code>ValueError: DateFormatter found a value of x=0, which is an illegal 
  date; this usually occurs because you have not informed the axis that 
  it is plotting dates, e.g., with ax.xaxis_date()
  </code></pre>
  <p>Upon checking the datetime column I get following output with data type type of the column:</p>
  <pre><code>0     2020-01-01 00:00:00
  1     2020-01-01 01:00:00
  2     2020-01-01 02:00:00
  3     2020-01-01 03:00:00
  4     2020-01-01 04:00:00
            ...        
  307   2020-01-13 19:00:00
  308   2020-01-13 20:00:00
  309   2020-01-13 21:00:00
  310   2020-01-13 22:00:00
  311   2020-01-13 23:00:00
  Name: datetime, Length: 312, dtype: datetime64[ns]
  </code></pre>
  <p>I was suspecting the x ticks so when I ran <code>g.get_xticks()</code> [which gets the ticks on x-axis], I got output as ordinal numbers. Can anyone tell why is this happening?</p>