How can I control the binning and plot limits, and to do so independently?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 576
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
I would like fine-grained control over the binning scheme, but at the moment I think I can only provide the number of bins using the bins argument, e.g. bins=20. Is it possible to, for example, supply bin ranges e.g. bins=np.linspace(-1.0,1.0,11)? Or is there another way to achieve the same outcome?
Having binned the data, I would then like to set the limits for each axis. This would be plt.xlim(a,b) and plt.ylim(c,d) in matplotlib. How can I set the axis ranges in/for corner plots?
The need for independent control is to ensure the plotted probability distribution correctly includes the points outside the plot range, and is not influenced by the given axis limits, unless this is specifically required for a particular problem.
[Specifically, for this use case, I have NaNs that I would like to exclude using a magic number, but I want the magic location to be excluded from binning and plotting. The NaNs are uncorrelated, i.e. samples are incomplete and excluding by sample is not possible. But I think this is for a separate question?]
Essentially I would like a manual rather than auto mode.
@dfm Does that make sense? Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the corner plot API and trace how the bins argument currently controls both binning and displayed ranges. Check the existing plotting tests, if available, for bin and axis-limit behavior. Done means accepting explicit bin ranges, allowing independent x and y limits, and keeping out-of-range samples and excluded NaN replacements out of the plotted distribution as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, numpy, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100