title: Matplotlib Annotating Line Plot By Iterating Over Second Set Of Values
body: <p>I am trying to build a line plot in matplotlib using a single set of date values and counts but then annotating that same plot with a second set of values. So far I have this:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  count_dates_dict = {u'Mon Feb 13 05:19:09 +0000 2012': 18, u'Mon Feb 13 05:19:04 +0000 2012': 36, u'Mon Feb 13 05:19:03 +0000 2012': 32, u'Mon Feb 13 05:18:58 +0000 2012': 14, u'Mon Feb 13 05:19:10 +0000 2012': 33, u'Mon Feb 13 05:19:02 +0000 2012': 28, u'Mon Feb 13 05:18:59 +0000 2012': 33, u'Mon Feb 13 05:19:11 +0000 2012': 38, u'Mon Feb 13 05:19:12 +0000 2012': 41, u'Mon Feb 13 05:19:08 +0000 2012': 31, u'Mon Feb 13 05:19:07 +0000 2012': 41, u'Mon Feb 13 05:19:06 +0000 2012': 46, u'Mon Feb 13 05:19:05 +0000 2012': 33, u'Mon Feb 13 05:19:00 +0000 2012': 35, u'Mon Feb 13 05:19:01 +0000 2012': 28, u'Mon Feb 13 05:19:13 +0000 2012': 13}
  
  sorted_annotation_dates_dict = {u'Mon Feb 13 05:19:09 +0000 2012': 1, u'Mon Feb 13 05:19:03 +0000 2012': 1, u'Mon Feb 13 05:19:02 +0000 2012': 1, u'Mon Feb 13 05:18:59 +0000 2012': 1, u'Mon Feb 13 05:19:11 +0000 2012': 1, u'Mon Feb 13 05:19:12 +0000 2012': 1, u'Mon Feb 13 05:19:07 +0000 2012': 1, u'Mon Feb 13 05:19:00 +0000 2012': 1, u'Mon Feb 13 05:19:01 +0000 2012': 1, u'Mon Feb 13 05:19:13 +0000 2012': 1}
  
  fig = plt.figure(figsize=(15,5))
  ax = plt.axes()
  ax2 = plt.axes()
  plt.xticks(range(0, len(count_dates_dict.values())), sorted(count_dates_dict.keys(), reverse=False), rotation=90, color = 'b')
  
  ax.plot(count_dates_dict.values(), color = 'g')
  
  for item in sorted(sorted_annotation_dates_dict).keys():
      ax.annotate(item, xytext=('Point of Intrest'), rotation=90, arrowprops=dict(connectionstyle="arc3"), xy=(item))
  
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/dQVvt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dQVvt.png" alt="baseplot"></a></p>
  
  <p>Obviously, this also throws an error about having too many values to unpack for the annotation. I'm not sure I completely understand what the annotation wants. I assume that the xy= needs to be some set of points for the arrow? Any help is always appreciated.</p>