title: How to manually add labels to plot or map the dictionary efficiently to display on your plot
body: <p>I am working with two <code>Pandas dataframes</code>. In the first <code>dataframe</code>. I am interested in matching the <code>ProductID</code> with the <code>CompanyName</code> that purchased a product. </p>
  
  <p>In order to solve this problem matching. I first create an <code>empty dictionary</code> and then <code>loop</code> through the <code>rows</code> of the <code>dataframe</code> and <code>update</code> the <code>dictionary</code> as shown below</p>
  
  <pre class="lang-py prettyprint-override"><code>Slice = {}
  for i,j in df.iterrows():
      Slice.update({j.ProductID:j.CompanyName})
  
  </code></pre>
  
  <p>Now I am trying to plot the <code>productID</code> and put a <code>label</code> of the company the <code>ProductID</code> is associated with</p>
  
  <pre class="lang-py prettyprint-override"><code>plt.figure(figsize=(30,25))
  color = ["#FF0000", "#00FF00", "#008080", "#FF00FF",
            "#FFD088", "#B3AFB2", "#A9CCE3", "#3333eb"]
  figure1 = df.ProductID.value_counts().nlargest(8).plot(kind="bar", color=color)
  figure1.tick_params(labelsize=30)
  Tar_1 = [Slice[124],Slice[920],Slice[162],Slice[166], Slice[165], Slice[923],Slice[1759], Slice[476]]
  
  plt.legend(handles=Tar_1)
  </code></pre>
  
  <p>I get the following error: <code>AttributeError: 'str' object has no attribute 'get_label'</code></p>
  
  <p>Please how can I resolve this issue? Or do you have a better approach? I was thinking of <code>mapping</code> the <code>productID</code> from the dictionary created but the column created generated all <code>NaN</code></p>
  
  <p>Kindly advise.</p>