-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Densityplot: add support for discrete variables #2878
Conversation
Can you post a screen shot/example of what this looks like? Maybe also a test (our plotting "tests" are just making sure you can call the functions)? |
In this example sigma is continuous and gamma discrete Densityplot is already included in our tests (see #2741) |
ups! I just notice a problem (with the xticks) |
bins = range(xmin, xmax+1) | ||
if outline: | ||
ax.hist(vec, bins=bins, color=c, histtype='step') | ||
ax.hist(vec, bins=bins, color=c, alpha=shade) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to set density=None
to True.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will only change the scale of y. But that scale is not plotted, the yticks are set to an empty list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Fine with me.
pymc3/plots/densityplot.py
Outdated
@@ -64,7 +65,7 @@ def densityplot(trace, models=None, varnames=None, alpha=0.05, point_estimate='m | |||
|
|||
""" | |||
if point_estimate not in ('mean', 'median', None): | |||
raise ValueError("Point estimate should be 'mean' or 'median'") | |||
raise ValueError("Point Estimate should be 'mean', 'median' or None") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why Estimate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a typo
This looks great! |
No description provided.