Screen Link:
https://app.dataquest.io/m/147/improving-plot-aesthetics/6/hiding-tick-marks
My Code:
ax.plot(women_degrees['Year'], women_degrees['Biology'], c= 'blue', label='Women')
ax.plot(women_degrees['Year'], 100-women_degrees['Biology'], c ='green', 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()
Replace this line with your code
``` #solution 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.set_title('Percentage of Biology Degrees Awarded By Gender')
ax.legend(loc="upper right")
plt.show(
What I expected to happen:
* Generate 2 line charts in the same plotting area:
* One that visualizes the percentages of Biology degrees awarded to women over time. Set the line color to `"blue"` and the label to `"Women"` .
* One that visualizes the percentages of Biology degrees awarded to men over time. Set the line color to `"green"` and the label to `"Men"` .
* Remove all of the tick marks.
* Set the title of the plot to `"Percentage of Biology Degrees Awarded By Gender"` .
* Generate a legend and place it in the `"upper right"` location.
What actually happened:
``` color specifications are not mentioned in the answer code
Replace this line with the output/error
As per instructions, we should mention color specifications for both male and female percentages to see the differentiation in the line charts. I am just curious to know why the color specifications are not mentioned in the solution code , and it still allows to be considered as correct answer.
I just want to understand the logic behind this?
Please let me know if i am missing something here.
Thanks for your help.
Best
K!