Skip to content

Fix: Ensure ScalarFormatter.set_useOffset properly distinguishes betw… #29537

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

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

masihkhatibzadeh99
Copy link
Contributor

Fixes: #29532

  • Updated the ScalarFormatter.set_useOffset method to explicitly check for boolean types using isinstance(val, bool).
  • This ensures that numeric values are treated as explicit offsets and not as enabling the automatic offset mode.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Looks good, but you need to fix the flake8 errors.

@masihkhatibzadeh99
Copy link
Contributor Author

Sure @jklymak. i'll fix it.

@rcomer rcomer added this to the v3.11.0 milestone Jan 28, 2025
@rcomer
Copy link
Member

rcomer commented Jan 28, 2025

Not sure about the milestone: I think there’s a chance someone somewhere is deliberately using 1 to mean True, so picked 3.11 to not break them in a micro release. Maybe I’m overthinking it?

@rcomer rcomer merged commit 05a66bb into matplotlib:main Jan 29, 2025
38 of 41 checks passed
@rcomer
Copy link
Member

rcomer commented Jan 29, 2025

Thanks @masihkhatibzadeh99 and congratulations on your first Matplotlib PR 🎉

We hope to hear from you again.

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.

[Bug]: ScalarFormatter cant be forced to use an offset of 1
3 participants