Skip to content

Instantly share code, notes, and snippets.

@dhinojosa
Created June 13, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhinojosa/f93e7adb2a711b87d42fea8dc7ccdebc to your computer and use it in GitHub Desktop.
Save dhinojosa/f93e7adb2a711b87d42fea8dc7ccdebc to your computer and use it in GitHub Desktop.
BarChart.py
raw = merged.sort_values('Count', ascending=False)[:10]
xticks = np.arange(10)
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, sharex=False, sharey=False)
ax1.bar(xticks, raw['Count'])
ax1.set_title('Complaints by States\n(raw)')
ax1.set_xticks(xticks)
ax1.set_xticklabels(raw['State'])
ax2.bar(xticks, normalized['population_normalized'])
ax2.set_title('Complaints by States\n(normalized for population)')
ax2.set_xticks(xticks)
ax2.set_xticklabels(normalized['State'])
plt.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment