79823621

Date: 2025-11-18 17:00:53
Score: 1
Natty:
Report link

If I had to guess, I’d call plt.show(block=False) followed by plt.pause(0) before your first measurement.

This forces the GUI backend to finalize the window and apply fullscreen, so fig.get_size_inches() is correct immediately.

fig.canvas.manager.full_screen_toggle()

plt.show(block=False)

plt.pause(0)   # forces one GUI event cycle

The figure does not have its true on-screen size until the GUI event loop runs once. Fullscreen mode is only applied during that first event cycle. plt.pause(0) is the clean way to let the backend process pending events without adding delays, so the correct size is available at the first measurement.

(PS: All comments are appreciated, I’m new around here)

Reasons:
  • Blacklisted phrase (1): appreciated
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Chip01