az.plot_dist(kind=hist) and bins arg raises exception
See original GitHub issueFollowing code raises an exception
import arviz as az
newcomb = pd.read_csv("https://raw.githubusercontent.com/avehtari/ROS-Examples/master/Newcomb/data/newcomb.txt")
az.plot_dist(newcomb.values, hist_kwargs=dict(bins=30))
Matplotlib version does not
import matplotlib.pyplot as plt
newcomb = pd.read_csv("https://raw.githubusercontent.com/avehtari/ROS-Examples/master/Newcomb/data/newcomb.txt")
plt.hist(newcomb.values,bins=30)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
az.plot_dist(kind=hist) and bins arg raises exception #1306
Following code raises an exception import arviz as az newcomb ... az.plot_dist(kind=hist) and bins arg raises exception #1306.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, there is an error. We probably should grab the bins returned from the plot call.
https://github.com/arviz-devs/arviz/blob/d046cea6d2847c63f9207826d8e478e429ae2374/arviz/plots/backends/matplotlib/distplot.py#L126
to
The idea would be something like this test where instead of using
continuous_model["y"]
as data a list was passed as data. Similar test with matplotlib here too in case it helps.We want to make sure the preprocessing works and the figure is generated, what is not checked is the generated figure so things like color, axis limits… are generally not chekced. In this particular case we actually want to check the preprocessing basically so everything should work fine.