fix: resolve FigureCanvasTkAgg clipping on Windows HiDPI#31133
fix: resolve FigureCanvasTkAgg clipping on Windows HiDPI#31133intelliking wants to merge 4 commits intomatplotlib:mainfrom
Conversation
|
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. |
|
I think I understand how this works, but it feels like there should be a better way in tk for widgets to be notified that their size is changed. We should be using that mechanism (possibly re-working how we currently do it) instead#. |
Thanks @tacaswell , I see what you mean. I’ll try to find a better Tk-native way for widgets to react to size changes and rework the current approach based on that. |
PR summary
Closes #31126
Why is this change necessary?
FigureCanvasTkAggembedded in layout-managed containers renders plots larger than the visible area, clipping axis labels and legends.What problem does it solve?
<Configure>event from firing and leavingfigure.size_inchesmiscalculated, causing the render buffer to exceed the visible canvas size.What is the reasoning for this implementation?
resize()to recalculatefigure.size_incheswith the correct DPI, ensuring render size matches visible size.PR checklist