2

I made a ggplot, including labels above every point of observation. For the points and lines of the chart I manually set colours:

ggplot(data = dfpl2,
       aes(x = Jahr, y = Positiv, group = Landtag, col = Landtag))+
  geom_point(size=3)+
  geom_line()+
  scale_colour_manual(values=c("#CC0000", "#0066FF", "#FF0000"))+
  geom_label(data = dfpl2,
             aes(label = Jahr, fill = factor(Landtag)),
             nudge_y=0.25, colour="white", fontface="bold")+
  scale_x_continuous(name="Jahr", limits=c(2003,2018)))

How can use those manually chosen colours for the labels? When using the fill command, only the standard colours appear.

Z.Lin
  • 28,055
  • 6
  • 54
  • 94
M.Wagner
  • 21
  • 1
  • 3
    Try adding `scale_fill_manual(values=c("#CC0000", "#0066FF", "#FF0000"))` to your code. If that doesn't work for you, please make your question [**reproducible**](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by editing your question with the output of `dput(dfpl2)`, so that others can troubleshoot more accurately. – Z.Lin Jan 26 '19 at 08:39
  • Great, thank you very much! Your solution did work, thanks! – M.Wagner Jan 27 '19 at 07:46

0 Answers0