title: How to label bubble chart/scatter plot with column from pandas dataframe?
body: <p>I am trying to label a scatter/bubble chart I create from matplotlib with entries from a column in a pandas data frame. I have seen plenty of examples and questions related (see e.g. <a href="https://stackoverflow.com/questions/40979026/how-to-label-data-points-in-matplotlib-scatter-plot-while-looping-through-pandas">here</a> and <a href="https://stackoverflow.com/questions/14432557/matplotlib-scatter-plot-with-different-text-at-each-data-point">here</a>). Hence I tried to annotate the plot accordingly. Here is what I do: </p>
  
  <pre><code>import matplotlib.pyplot as plt
  import pandas as pd 
  #example data frame
  x = [5, 10, 20, 30, 5, 10, 20, 30, 5, 10, 20, 30]
  y = [100, 100, 200, 200, 300, 300, 400, 400, 500, 500, 600, 600]
  s = [5, 10, 20, 30, 5, 10, 20, 30, 5, 10, 20, 30]
  users =['mark', 'mark', 'mark', 'rachel', 'rachel', 'rachel', 'jeff', 'jeff', 'jeff', 'lauren', 'lauren', 'lauren']
  
  df = pd.DataFrame(dict(x=x, y=y, users=users)
  
  #my attempt to plot things
  plt.scatter(x_axis, y_axis, s=area, alpha=0.5)
      plt.xlabel(xlabel)
      plt.ylabel(ylabel)
      plt.annotate(df.users, xy=(x,y))
      plt.show()
  </code></pre>
  
  <p>I use a pandas datframe and I somehow get a KeyError- so I guess a <code>dict()</code> object is expected? Is there any other way to label the data using with entries from a pandas data frame? </p>