title: How to plot average in y axis for each x value in pyplot
body: <p>I am using  matplotlib.pyplot to visualize my data. In pandas I have columns 'hour' and <code>'favourite_count'</code>. hour has values form 0 to 24. <code>favourite_count</code> is a continuous variable. What I want is to plot a bar chart which visualizes the average <code>favourite_count</code> for each hour. Currently I am plotting a basic graph as below. In the y axis this plots the sum / maximum of <code>favourite_count</code> for each hour (I am not sure which). How can I plot a graph that visualizes hour vs <code>average_favorite_count_for_hour</code> </p>
  
  <pre><code>plt.bar(result['hour'], result['favourite_count'])
  plt.xlabel('hour')
  plt.ylabel('favourite_count')
  plt.title('hour vs popularity', y=1.1)
  plt.grid()
  plt.show()
  </code></pre>