Unable to Submit solution

Screen Link:
https://app.dataquest.io/m/147/improving-plot-aesthetics/4/visualizing-the-gender-gap

My Code:

import matplotlib.pyplot as plt
male_biology=100-women_degrees["Biology"]
female_biology=women_degrees["Biology"]
year=women_degrees["Year"]
plt.plot(year,male_biology,c="green",label="Men")
plt.plot(year,female_biology,c="blue",label="Women")
plt.title("Percentage of Biology Degrees Awarded By Gender")
plt.legend(loc="upper right")
plt.show()

What I expected to happen:
Successful submission.

What actually happened:

Your 1st plot doesn't match what we expected.

The plot seems to be correct kindly check once if this is an issue with the platform itself.

Unfortunately, this is more of an issue with the specifics of their Grader.

They want the Legend to be such that you have Women appear above Men in the Legend.

So, you only need to interchange the following two lines -

plt.plot(year,male_biology,c="green",label="Men")
plt.plot(year,female_biology,c="blue",label="Women")

to (notice the interchange)

plt.plot(year,female_biology,c="blue",label="Women")
plt.plot(year,male_biology,c="green",label="Men")

you should pass the Grader.

1 Like

Hi, you are inverting the plot :slight_smile: try this:

plt.plot(year,female_biology,c="blue",label="Women")
plt.plot(year,male_biology,c="green",label="Men")

1 Like