Screen Link: https://app.dataquest.io/m/147/improving-plot-aesthetics/6/hiding-tick-marks
Your Code:
fig, ax = plt.subplots()
ax.plot(women_degrees["Year"], women_degrees["Biology"], label="Women")
ax.plot(women_degrees["Year"], 100-women_degrees["Biology"], label="Men")
ax.tick_params(bottom="off",top="off",left="off",right="off")
ax.legend("upper right")
ax.set_title("Percentage of Biology Degrees Awarded By Gender")
plt.show()
What actually happened:
The output in the Legend is just u instead of Women and p instead of Men but i expected the output Women and Men.
Other details:
In the lesson befor, i wrote the same code and it displayed “Women” and “Men”
After it don’t works I copy and paste the answer and it display it correct.
fig, ax = plt.subplots()
ax.plot(women_degrees['Year'], women_degrees['Biology'], label='Women')
ax.plot(women_degrees['Year'], 100-women_degrees['Biology'], label='Men')
ax.tick_params(bottom="off", top="off", left="off", right="off")
ax.set_title('Percentage of Biology Degrees Awarded By Gender')
ax.legend(loc="upper right")
plt.show()