I have a problem with adding a legend to my plot. My code below:
ggplot(data = dane2, aes(x = iterations, y = powers, color = 'Moc testu')) +
geom_line(col = 'red')+
geom_line(data = dane3, aes(x = iterations, y = blad_II_r, color = 'Błąd II rodzaju')
, color = 'orange')+
ggtitle('Błąd II rodzaju i moc testu w zależności od ilości iteracji') +
xlab('iteracja') +
ylab('') +
ylim(-0.01, 1) +
scale_color_manual(name = "", values = c("Moc testu" = "red", "Błąd II rodzaju" = "orange"))+
guides(color = guide_legend(title = "Legenda")) +
theme(legend.position = 'right')
The legend doesn't show and I don't know why. Could you help?
I tried to plot with this code and it still doesn't work.
Thanks in advance!