title: Seaborn plot bar time series x-axis : how to display the value of each bar
body: <p>How to display value of each bar when your figure (bar) has time series as X-axis : </p>
  
  <p>I have a dataframe df_final_seaborn :</p>
  
  <p><a href="https://i.stack.imgur.com/vqJgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vqJgK.png" alt="enter image description here"></a></p>
  
  <pre><code>    Covid-19 Madagascar Isan'ny olona
  Daty        
  2020-05-24  Sitrana isan'andro  4
  2020-05-24  Maty                0
  2020-05-25  Marary isan'andro   15
  2020-05-25  Sitrana isan'andro  5
  2020-05-25  Maty                0
  </code></pre>
  
  <p>and to plot bar with the following code :</p>
  
  <pre><code>sns.set(rc={'figure.figsize':(30,15)},palette=['#F70A0A','#2A930C','#930C85'], font_scale=1.7)
  # pour les axes 
  ax = sns.barplot(x=df_final_seaborn.index,y='Isan\'ny olona',data=df_final_seaborn,hue='Covid-19 Madagascar')
  sns.set_style("darkgrid" , {"ytick.major.size": 10 , "ytick.minor.size": 2 , 'grid.linestyle': '--'})
  plt.xticks(rotation=90)
  plt.xlabel('Daty', fontsize = 20)
  plt.ylabel('Isan\'ny olona', fontsize = 20)
  plt.minorticks_on()
  plt.legend(loc='upper left')
  plt.grid(b=True, which='minor', color='#999999', linestyle='-', alpha=0.2 , axis='y')
  ax.xaxis.set_major_formatter(plt.FixedFormatter(df_sea.index.to_series().dt.strftime("%Y-%m-%d")))
  plt.show()
  </code></pre>
  
  <p>the result is :</p>
  
  <p><a href="https://i.stack.imgur.com/TszvE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TszvE.jpg" alt="enter image description here"></a></p>
  
  <p>My problem is how to display each value of bar :</p>
  
  <p>I followed the same problem here <a href="https://stackoverflow.com/questions/43214978/seaborn-barplot-displaying-values">enter link description here</a> by addind the code below </p>
  
  <pre><code>for index , row in df_final_seaborn.iterrows():
     ax.text(row.name,row['Isan\'ny olona'], round(row['Isan\'ny olona'],0), color='black', ha="center")
  
  
  plt.show()
  
  Out : TypeError: float() argument must be a string or a number, not 'Timestamp'
  </code></pre>
  
  <p>for information when I put </p>
  
  <pre><code>for index , row in df_final_seaborn.iterrows():
      print(index)
      print(row)
  </code></pre>
  
  <p>the result will be :</p>
  
  <p><a href="https://i.stack.imgur.com/ldXoP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ldXoP.png" alt="enter image description here"></a></p>
  
  <p>Another solution  is via  matplotlib like here : <a href="https://stackoverflow.com/questions/30228069/how-to-display-the-value-of-the-bar-on-each-bar-with-pyplot-barh">enter link description here</a></p>
  
  <p>adding this before : plt.show()</p>
  
  <pre><code>for i , v in enumerate (df_final_seaborn):
         plt.text(df_final_seaborn.iloc[i], v + 0.01, str(v))
  </code></pre>
  
  <p>out : </p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-127-717d236faadf&gt; in &lt;module&gt;
       12 ax.xaxis.set_major_formatter(plt.FixedFormatter(df_sea.index.to_series().dt.strftime("%Y-%m-%d")))
       13 for i , v in enumerate (df_final_seaborn):
  ---&gt; 14        plt.text(df_final_seaborn.iloc[i], v + 0.01, str(v))
       15 #      print(i)
       16 #      print(v)
  
  TypeError: can only concatenate str (not "float") to str
  </code></pre>
  
  <p>have an idea ?</p>