StructEst_W20
StructEst_W20 copied to clipboard
Plotting in PS3 1.B
This plot has been taking me forever and I think I am getting further. The np.hist function returns a tuple, i transform the tuple into a pandas data frame and calculate percentages. The pandas matplotlib functionality sucks, but I'm not sure how to specify anything in a matplotlib histogram. How does matplotlib make sense of what is x and y from a np array? How can i specify a specific bin's width?
Like how would "dividing a bar's percentage" work? In the data before I plot?
counts, _, _ = plt.hist(...) plt.close() # Don't want the plot from plt.hist for n, Y in enumerate(counts): X = [n*.3 + x for x in range(len(Y))] # position bars next to each other plt.bar(X, Y, 0.3)
Doing this does nothing and I can't replot after I alter bins anyways