Last active
October 5, 2018 15:26
-
-
Save nkconnor/6912f23c37a8b30fef2427240dc87bf4 to your computer and use it in GitHub Desktop.
MEPS respondent expenditure histogram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import matplotlib.ticker as mtick | |
import meps | |
survey = meps.as_dataframe("h192") | |
fig, ax = plt.subplots(1, 1, figsize=(9, 4)) | |
fmt = '${x:,.0f}' | |
tick = mtick.StrMethodFormatter(fmt) | |
ax.xaxis.set_major_formatter(tick) | |
plt.xlabel('Total Expenditure in Dollars') | |
plt.ylabel('Number of Respondents') | |
survey['TOTEXP16'].hist(log=True, xrot=0., bins=6, rwidth=0.75, align="left") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment