Skip to content

Instantly share code, notes, and snippets.

@jacobod
Created March 15, 2018 04:09
Show Gist options
  • Save jacobod/7791217dd2271ebd62f099d6fefb21f1 to your computer and use it in GitHub Desktop.
Save jacobod/7791217dd2271ebd62f099d6fefb21f1 to your computer and use it in GitHub Desktop.
#creating plot
fig, ax = plt.subplots(1,1,figsize=(9,6))
c_map = {1: 'r', 0: 'b'}
ax.scatter(enron_df['salary'],enron_df['long_term_incentive'],
c=[c_map[i] for i in enron_df['poi']])
plt.ylabel("Long Term Incentive ($)")
plt.xlabel("Salary ($)")
plt.title("Salary vs. Long Term Incentive")
not_poi = mlines.Line2D([], [], color='blue', marker='o',
markersize=10, label='Not POI')
poi = mlines.Line2D([], [], color='red', marker='o',
markersize=10, label='POI')
plt.legend(handles=[not_poi,poi])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment