Generate a histogram of pass angles, set the fill to be blue, then overlay a line graph for pass.lengths vs pass.angles, set the line colour to be red.

I am trying to solve this question: Generate a histogram of pass angles, set the fill to be blue, then overlay a line graph for pass.lengths vs pass.angles, set the line colour to be red.
I put in the code but I cannot figure out how to make the line colour red. The following code gives me a black line. What should I add to generate a red line?

ggplot(passing, aes(pass.angle))+
geom_histogram(fill="blue1")+
geom_line(aes(x=pass.angle, y=pass.length))

In geom_histogram, you set the fill to be blue1. The equivalent argument in geom_line would be to set the color to be red outside of the aes() function.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.