Without diving deep and getting technical, I wish to say:
the project a good start in terms of intro and the goal section is a nice addition.
what could be added to your project is a conclusion part one after each plot, and one at the end like a brief overall of the project and its closing.
for the grouped plot, you have highlighted all the majors, but since there are so many, we canât clearly know what is what. as an extra challenge check out the annotations in plots.
(for this plot, you can perhaps do this, annotate the most preferred and least preferred major.
So all the bars will still be visible but the longest one and smallest ones will be identifiable something like this:)
Hi,
I tried to do annotations.But I am stuck.
This is what i did.
grouped=recent_grads.groupby(âMajor_categoryâ).agg({âMenâ:âsumâ,
âWomenâ:âsumâ
})
grouped[âTotalâ]=grouped[âMenâ]+grouped[âWomenâ]
grouped # data to plot
grouped[âTotalâ].max()
grouped.plot.bar(figsize=(15,10)).set_title(âcomparison b/w Men and Womenâ).annotate(âMost number of studentsâ,xy=(3,1302376.0),xytext=(5,1302378),arrowprops = dict(facecolor=âredâ,shrink=0.05))
Did you try to google it? or check out the official documentation for its usage?
One alternative that I could do is as below:
fig, ax = plt.pyplot.subplots(figsize = (15,12))
grouped.plot.bar(ax = ax).set_title('comparison b/w Men and Women')
ax.annotate('Most number of students',xy=(3,1302376.0),xytext=(5,1302378),arrowprops = dict(facecolor='red',shrink=0.05))
Thanks for the reply.
Yes I tried to google it.This worked except I gave
fig,ax = plt .subplots (figsize =(15,12))
instead of
fig,ax = plt .pyplot.subplots (figsize =(15,12)) which gave me an error.
I tried the same code but what i missed was (ax=ax).