Artificial gaps when plotting discrete data in distplot
See original GitHub issueAn issue that arises when plotting histograms of discrete data with Matplotlib seems to also come up in distplot
as well. That is, there are often empty bins in the histogram that are entirely artifacts of the plot. See here for an example with Poisson data:
Is there any way that distplot
could try to detect this and adjust the bins automagically?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Visualizing distributions of data - Seaborn - PyData |
A histogram is a bar plot where the axis representing the data variable is divided into a set of discrete bins and the...
Read more >How to make discrete pcolor x-axis with no gaps between ...
You want to plot the data points at x = 1, 4, 9, 16, etc. separated by only one space? If so, the...
Read more >Discrete Data Analysis with R: Visualization and Modeling ...
Find one or more examples of a graph or table that is a particularly bad use of display material to summarize and communicate...
Read more >Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, ... Our plot is looking nicer, but the spaces between the lines...
Read more >What to do with missing values when plotting with seaborn?
seaborn.distplot(data['alcconsumption'].notnull(),hist=True,bins=100) ... I would definitely handle missing values before you plot your data.
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 you need to do
bins=np.arange(data.min(), data.max() + 1)
Thanks @mwaskom!