StructEst_W20 icon indicating copy to clipboard operation
StructEst_W20 copied to clipboard

Plotting in PS3 1.B

Open davefoote opened this issue 5 years ago • 2 comments

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?

davefoote avatar Feb 10 '20 16:02 davefoote

Like how would "dividing a bar's percentage" work? In the data before I plot?

davefoote avatar Feb 10 '20 16:02 davefoote

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

davefoote avatar Feb 10 '20 16:02 davefoote