Q:

Difficulty adjusting color inn ggplot2 using r

I am trying to match plots I make in R to plots I make in python using matplotlib.
The current code I use does not match the custom colors I want to use correctly. What can I change to get this to work correctly?
My main concern is matching the colour of the lines.
I am trying to use scale fill manual. This changes the colours but not in the way I want.
ggplot(data = reactor.summarised.ci, aes(x=standard_time, y=value, group = 
group,  colour=group)) +
geom_line(size = 0.25)+
geom_ribbon(aes(x = standard_time, ymin = lower.ci.od, ymax = upper.ci.od), 
show.legend =FALSE, alpha =0.2, colour = NA)+
ylab("O.D.")+
xlab("Time (min)")+
xlim(0, 350)+
ggtitle('OD Over Time in in Bioreactor 1.02 before adjustment')+
theme(plot.title = element_text(hjust = 0.5))+
scale_fill_manual(values=c("#1f77b4", "#ff7f0e", "#2ca02c", '#d62728'))+
newtheme

newtheme is defined as follows:
newtheme <-  theme_classic()+
          theme(plot.title = element_text(hjust = 0.5))

I want to assign the following colours to the figure legend, ribbon and line.
(ReactorA = "#1f77b4", 
ReactorB = "#ff7f0e",
ReactorC = "#2ca02c",
Reactor '#d62728')

current plot generated

A:

You are mapping group to color not fill. Therefore  you have to use scale_color_manual to adjust the color of the lines. Try this:
ggplot(data = reactor.summarised.ci, aes(x=standard_time, y=value, group = 
                                             group,  colour=group)) +
    geom_line(size = 0.25)+
    geom_ribbon(aes(x = standard_time, ymin = lower.ci.od, ymax = upper.ci.od), 
                show.legend =FALSE, alpha =0.2, colour = NA)+
    ylab("O.D.")+
    xlab("Time (min)")+
    xlim(0, 350)+
    ggtitle('OD Over Time in in Bioreactor 1.02 before adjustment')+
    theme(plot.title = element_text(hjust = 0.5)) +
    scale_color_manual(values=c("reactorA" = "#1f77b4", "reactorB" = "#ff7f0e", "reactorC" = "#2ca02c", "reactorD" = '#d62728'))+
    newtheme

