ggplot label bars in grouped bar plot
<p>The data I am trying to plot is structured as follows:</p>

<pre><code>      Year                        Country                           Count   
 1:   2010 St. Vincent and the Grenadines                               0
 2:   1970                        Ukraine                               0
 3:   1980                          Yemen                               1
 4:   1970                        Romania                               0
 5:   1950                         Cyprus                               0
 6:   1950                    Netherlands                               0
 7:   1980                     Mauritania                               0
 8:   1980                          Niger                               0
 9:   2010                        Grenada                               2
10:   1970                         Israel                               6
11:   1990                       Suriname                               0
12:   1990                      Singapore                               1
13:   1960                         Russia                               0
14:   1970                       Barbados                               0
15:   1950                         Panama                               0
16:   2010                           Mali                               3
17:   1980                         Greece                              11
18:   2010                      Venezuela                              15
19:   2000                         Malawi                               9
20:   2000                        Jamaica                              34
21:   1970                         Angola                               0
22:   1990                        Lebanon                               0
23:   1980       Central African Republic                               0
24:   1950                 United Kingdom                               1
25:   2010                        Iceland                              26
</code></pre>

<p>I have created the following grouped bar-graph out of it:
<a href="https://i.stack.imgur.com/KqZSC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KqZSC.png" alt="Grouped Bar Graph"></a></p>

<p>I need the country labels to line-up with their corresponding bars. Even after consulting <a href="https://stackoverflow.com/questions/18518558/label-bar-plot-with-geom-text-in-ggplot">here</a> and <a href="http://docs.ggplot2.org/current/geom_text.html" rel="noreferrer">here</a> and using <em>position = position_dodge(width= 0.9)</em> as suggested in the links, the labels don't seem to align. I have also tried different values for <em>width</em>.</p>

<p>Here is the code to create the plot above:</p>

<pre><code>&gt; p&lt;-ggplot(x[which(x$Count&gt;0)], aes(Year, Count, label=Country)) + geom_bar(aes(fill = Country), position = "dodge", stat="identity")
&gt; p+ theme(legend.position="none")+scale_x_discrete(limits=unique(x$Year))+geom_text(position = position_dodge(width= 0.9), aes(y=Count+10), angle=90)
</code></pre>