Skip to content
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

Remove hard-coded gridsize in density_hexbin #263

Merged
merged 5 commits into from
Jan 24, 2025
Merged

Conversation

jcwang587
Copy link
Contributor

@jcwang587 jcwang587 commented Jan 24, 2025

custom gridsize example:

import pymatviz as pmv

dummy_data = pmv.data.regression()
pmv.utils.apply_matplotlib_template()

ax = pmv.density_hexbin(
    dummy_data.y_pred,
    dummy_data.y_true,
    best_fit_line={"annotate_params": {"loc": "lower center"}},
    gridsize=40,
)

density-scatter-hex

jcwang587 and others added 5 commits January 24, 2025 00:31
for more information, see https://pre-commit.ci
replace direct imports of plot functions with pymatviz module attribute access
- Bump ruff to version 0.9.3, codespell to version 2.4.0, pyright to version 1.1.392.post0 in .pre-commit-config.yaml.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@janosh janosh changed the title Remove hardcoded gridsize in density_hexbin Remove hard-coded gridsize in density_hexbin Jan 24, 2025
Copy link
Owner

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jcwang587! 👍

@janosh janosh merged commit dbd3815 into janosh:main Jan 24, 2025
51 checks passed
@janosh janosh added enhancement Improvement to existing features/functionality matplotlib Concerning matplotlib-powered functions labels Jan 24, 2025
janosh added a commit that referenced this pull request Mar 28, 2025
* Remove hardcoded gridsize in density_hexbin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor test_scatter.py

replace direct imports of plot functions with pymatviz module attribute access
- Bump ruff to version 0.9.3, codespell to version 2.4.0, pyright to version 1.1.392.post0 in .pre-commit-config.yaml.

* cover gridsize in test_density_hexbin in test_scatter.py

* set x/y equal aspect ratio in density_hexbin

---------

Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing features/functionality matplotlib Concerning matplotlib-powered functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants