Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting in PS3 1.B #16

Open
davefoote opened this issue Feb 10, 2020 · 2 comments
Open

Plotting in PS3 1.B #16

davefoote opened this issue Feb 10, 2020 · 2 comments

Comments

@davefoote
Copy link

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
Copy link
Author

davefoote commented Feb 10, 2020

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

@davefoote
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant