Skip to content

Fix value error when set widget size to zero while using FigureCanvasQT #28523

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 1 commit into from
Jul 8, 2024
Merged

Conversation

ClarkeAC
Copy link
Contributor

@ClarkeAC ClarkeAC commented Jul 8, 2024

PR summary

Resize the Qwidget causes the FigureCanvasQT width to 0 will raise: RuntimeWarning: divide by zero encountered in scalar divide fig_aspect = bb.height / bb.width

Resize the Qwidget causes the FigureCanvasQT height to 0 will raise: ValueError: 'box_aspect' and 'fig_aspect' must be positive

Change FiCureCanvasQT widget size (w, h) from non-negative to positive to make sure fig_aspect is positive.

PR checklist

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.

@tacaswell tacaswell added this to the v3.9.2 milestone Jul 8, 2024
@ksunden ksunden merged commit 0fd212d into matplotlib:main Jul 8, 2024
42 of 43 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 8, 2024
timhoffm added a commit that referenced this pull request Jul 8, 2024
…523-on-v3.9.x

Backport PR #28523 on branch v3.9.x (Fix value error when set widget size to zero while using FiCureCanvasQT )
@QuLogic QuLogic changed the title Fix value error when set widget size to zero while using FiCureCanvasQT Fix value error when set widget size to zero while using FigureCanvasQT Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants