When I add the geom_text to the geom_bar, the whole plot gets messed up.
> x
# A tibble: 3 x 6
# Groups: Jahr, Monat, Bez [3]
Jahr Bez TWh Total Monat MonatsEAnteil
<chr> <fct> <dbl> <dbl> <chr> <dbl>
1 2000 Kleinwasserkraft 0.2 12 Dec 0.0167
2 2000 Speicherkraft 20.3 22856 Jan 1.93
3 2000 Speicherkraft 20.3 22856 Feb 1.30
ggplot (data = x, aes(x=Monat, y=MonatsEAnteil, fill = MonatsEAnteil))+
-
geom_col(aes(fill = Bez))
> ggplot (data = x, aes(x=Monat, y=MonatsEAnteil, fill = factor(MonatsEAnteil)))+
+ geom_col(aes(fill = Bez))+
+ geom_text(aes (label = MonatsEAnteil), size = 3,
position = position_stack(vjust = 0.5))
removing the second line (geom_text) makes it OK again. With the geom_text it creates a legend (for every value?).