title: How to plot element count and add annotations
body: <p>I was working &quot;globalterrorism.csv&quot; and wanted to visualise terrorist attacks in each country. I did this for the same:</p>
  <pre><code>len(gt['country_txt'].unique())
  </code></pre>
  <p>And I got 205 unique countries.</p>
  <pre><code>labels = gt.groupby([&quot;country_txt&quot;]).count()['eventid'].index
  
  
  x = np.array(list(gt.groupby([&quot;country_txt&quot;]).count()['eventid']))
  </code></pre>
  <p>while x is :</p>
  <pre class="lang-py prettyprint-override"><code>x = np.array([12629, 80, 2690, 1, 492, 1, 776, 23, 113, 112, 48, 5, 207, 1636, 3, 13, 151, 5, 8, 6, 309, 159, 10, 253, 6, 51, 52, 610, 248, 330, 94, 283, 87, 2352, 248, 7922, 5, 67, 57, 30, 130, 32, 10, 759, 41, 22, 3, 87, 38, 10, 210, 2479, 5274, 2, 9, 16, 167, 1, 17, 20, 2678, 7, 3, 8, 3, 206, 728, 19, 1268, 5, 56, 1984, 23, 8, 26, 212, 317, 26, 46, 4, 11748, 752, 1, 677, 24553, 299, 2171, 1536, 72, 35, 399, 107, 26, 677, 194, 73, 32, 27, 17, 2417, 28, 28, 2249, 8, 16, 33, 116, 25, 5, 95, 21, 561, 23, 12, 17, 2, 497, 21, 5, 36, 355, 543, 150, 1194, 121, 30, 1, 19, 1949, 148, 3864, 1, 6, 19, 14261, 126, 86, 113, 3, 6050, 6761, 39, 140, 7, 36, 83, 6, 2143, 157, 371, 117, 12, 11, 2, 87, 7, 18, 6, 4, 4093, 2015, 38, 225, 1, 2, 75, 3208, 2998, 2, 1, 942, 65, 16, 131, 107, 2198, 49, 181, 58, 3836, 48, 22, 107, 4260, 2, 390, 1708, 21, 5222, 2824, 76, 20, 2, 1, 273, 12, 1, 2196, 537, 4, 3309, 200, 50, 62, 100])
  </code></pre>
  <p>-len is 205</p>
  <pre><code>ax = plt.figure(figsize = (12,7))
  plt.hist(x, bins = 205)
  </code></pre>
  <p>This is the result:</p>
  <p><a href="https://i.stack.imgur.com/aY0Oa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aY0Oa.png" alt="enter image description here" /></a></p>
  <p>But I need to plot all the values of 'x' and have the lables against each of them!!</p>
  <p>Can somebody tell me how can I do that?</p>