position_fill requires non-overlapping x intervals in ggolot
<p>I am using ggplot to produce a bar chart stacked by a factor. And I use the following code</p>

<pre><code>ggplot(X) +
  geom_bar(aes(X$Decade, fill=factor(X$Motivation)),
       position='fill') +
  theme(legend.position = "bottom")+
  theme(axis.title.x = element_text(size = 20),
    axis.title.y = element_text(size = 20))+
  theme(text = element_text(size=20))+
  theme(legend.text = element_text(size = 16),legend.title = element_blank())+
  xlab("Decade")+
  ylab("Percentage")+
  scale_y_continuous(labels=percent)
</code></pre>

<p>However the program gives the following warning,</p>

<blockquote>
  <p>Warning message:
      position_fill requires non-overlapping x intervals </p>
</blockquote>

<p>The resulted figure is the below
<img src="https://i.stack.imgur.com/kmLiW.png" alt="plot"></p>

<p>It seems that the warning liers in the decade 1940. When the observations of 1940 are this <img src="https://i.stack.imgur.com/seQxI.png" alt="this"></p>

<p>I don't know what's the problem here, since other observations look like those of 1940 and when I removed 1940 observations, no warnings any more.</p>