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

Add distribution attribute to box plots to improve log-axis support #7392

Closed
wants to merge 1 commit into from

Conversation

chriddyp
Copy link
Member

@chriddyp chriddyp commented Mar 19, 2025

Fixes #7388

Summary

  • Add new distribution attribute to box plots with options 'normal', 'log-normal', and 'auto' (default)
  • Implement log-normal whisker calculation that prevents negative whiskers on log axes
  • Add tests and example files to verify behavior

Test plan

  • Run jasmine tests to verify correct behavior
  • Visual verification of test/image/mocks/box_distribution.json and box_distribution_log.json examples

🤖 Generated with Claude Code for $3 in 8 min.

Implements a new distribution attribute for box plots with three options:
- normal: Standard 1.5 * IQR rule for whiskers
- log-normal: Calculates whiskers based on IQR in log units
- auto (default): Uses log-normal on log axes, normal otherwise

Prevents negative whiskers when using log scales, which would appear as
infinitely long whiskers due to log axis behavior.

Fixes #7388

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@chriddyp
Copy link
Member Author

Just playing around with Claude Code as a proof of concept.

@chriddyp chriddyp closed this Mar 19, 2025
@chriddyp
Copy link
Member Author

@alexcjohnson - Does this code do what you'd expect from your issue that you raised in #7388?

@alexcjohnson
Copy link
Collaborator

Neat! The code looks promising, I’ll give it a try and see how well it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Box plots with log-scaled whiskers
2 participants