Improve error message for boxplot_stats function, by printing dimensions. by carlosgmartin · Pull Request #32305 · matplotlib/matplotlib · GitHub
Skip to content

Improve error message for boxplot_stats function, by printing dimensions. - #32305

Open
carlosgmartin wants to merge 1 commit into
matplotlib:mainfrom
carlosgmartin:boxplot_stats_improve_error_message
Open

Improve error message for boxplot_stats function, by printing dimensions.#32305
carlosgmartin wants to merge 1 commit into
matplotlib:mainfrom
carlosgmartin:boxplot_stats_improve_error_message

Conversation

@carlosgmartin

Copy link
Copy Markdown

PR summary

This edits the error message raised by boxplot_stats for incompatible dimensions to print those dimensions. This is useful for debugging. Related issue: #32304.

AI Disclosure

No AI used.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New features and API changes have release notes
  • [N/A] Documentation complies with general and docstring guidelines

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

@carlosgmartin
carlosgmartin force-pushed the boxplot_stats_improve_error_message branch from a0fae4d to dc75afb Compare September 5, 2026 18:29
@iccir

iccir commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Note that you need to use "Closes #X" explicitly in the PR in order to link the corresponding issue. See Linking a pull request to an issue using a keyword.

@iccir iccir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. I'll let the second reviewer decide if any of the formatting should be changed.

@carlosgmartin

Copy link
Copy Markdown
Author

@iccir This doesn't close the linked issue.

@jklymak jklymak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I rephrase this lot directly if we are making a change. "The number of labels ({len(labels)}) must match the number of columns {ncols}." "Compatible with" is vague in this case where there isn't more than one way they are compatible.

@carlosgmartin
carlosgmartin force-pushed the boxplot_stats_improve_error_message branch from dc75afb to 0f2ebb6 Compare September 5, 2026 20:56
@carlosgmartin

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants