arviz-devs / arviz-devs/arviz

Custom limits for 2D KDE

Open
#2,191 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TeX
Stars
1.9k
Forks
507
Avg merge
2d 20h
Merged PRs (30d)
3

Description

For feature parity with 1D KDE, custom limits could be supported in 2D.

I hacked an implementation by simply adding optional `xmin, xmax, ymin, ymax` arguments to `_fast_kde_2d` to override the limits inferred from the input data. Here's an example (left is current behavior of `plot_kde`, right has the same grey contours but the filled contour plot modifies `xmin` and `ymin`).

![image](https://user-images.githubusercontent.com/19390728/210270165-98d400b5-68f2-49f0-95f2-f1cd5199b061.png)

Just thought I'd throw this out there since the implementation is simple. Happy to share a reproducer (or draft a PR) if desired.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how plot_kde reaches _fast_kde_2d, then compare its limit handling with the 1D KDE path. Verify the requested optional xmin, xmax, ymin, and ymax behavior against the shown contour use case; done means custom limits work while existing inferred limits remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.