Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix: improve log-scale error message wording#31449

Merged
timhoffm merged 2 commits intomatplotlib:mainfrom
cbrethick:main
Apr 4, 2026
Merged

Fix: improve log-scale error message wording#31449
timhoffm merged 2 commits intomatplotlib:mainfrom
cbrethick:main

Conversation

@cbrethick
Copy link
Copy Markdown
Contributor

PR summary

This PR improves the wording of the error message raised when attempting to apply a log scale to data that contains no positive values.

The previous message:
"Data has no positive values, and therefore cannot be log-scaled."

has been updated to:
"Data cannot be log-scaled because all values are <= 0."

This change makes the message clearer and more direct for users.

Closes #31337

AI Disclosure

I used AI assistance to better understand the contribution steps and structure of the pull request. The actual code change is simple and written by me.

PR checklist

  • "closes #0000" is in the body of the PR description
  • [N/A] new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note
  • Documentation complies with general and docstring guidelines

Copy link
Copy Markdown
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

Thanks @cbrethick

Note for second reviewer: this is the second option from #31337 (comment)

@timhoffm timhoffm merged commit 0bef286 into matplotlib:main Apr 4, 2026
40 of 41 checks passed
@timhoffm
Copy link
Copy Markdown
Member

timhoffm commented Apr 4, 2026

Thanks @cbrethick

@rcomer rcomer added this to the v3.11.0 milestone Apr 4, 2026
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.

wording questions

3 participants