Matplotlib.pyplot - Values on Columns

Viewed 17

I am trying to add values to each column on this bar chart. I have tried scouring the web, but am having trouble finding the answer. I have pandas, numpy, and scipy.stat modules added. The bar chart renders just fine.

drug_regimen = clean_data_df['Drug Regimen'].sort_values().unique()
timepoint_count = clean_data_df.groupby('Drug Regimen')['Timepoint'].count()

x_axis = np.arange(len(drug_regimen))
tick_locations = [x for x in x_axis]

plt.figure(figsize=(12, 8))
plt.title("Timepoints Per Drug Regimen")
plt.xlabel("Drug Regiment")
plt.ylabel("Timepoint")

plt.bar(x_axis, timepoint_count, alpha=1, color="green", align="center")
plt.xticks(tick_locations, drug_regimen, color="black", rotation=45 )
plt.tight_layout
plt.show()
0 Answers
Related