0

I'm plotting two columns in the same histogram plot. Everything is great, but for some reason I got the legend beforew, now after rerunning the code, it's gone. Here is the code:

plt.hist(sample_200[sample_200['income'] == '<=50K']['hours-per-week'], bins = 25, label = 'Below 50K')
plt.hist(sample_200[sample_200['income'] == '>50K']['hours-per-week'], bins = 25, label = 'Above 50K' )
plt.title('Compare the X feature in the two Y labels')
plt.ylabel('Count')
plt.xlabel('Hours Per Week')

The plot:

enter image description here

Kev
  • 375
  • 1
  • 7

0 Answers0