I've been trying to set a fixed size padding (in pixels) on my matplotlib figure. I've never been able to find a solution that suits my needs on the internet so I had to make a little workaround for this, which is done with the following code :
def resizeEvent(self,e):
windowWidth=self.geometry().width()
windowHeight=self.geometry().height()
#print(windowWidth,windowHeight)
figure.subplots_adjust(left=100.0/windowWidth,right=1-100.0/windowWidth, top=1-100.0/windowHeight,bottom=100.0/windowHeight)
It works fine when manually resizing the window (we have a padding of 100px on every side).
Unfortunatly, when clicking Maximize, the padding (in 0 to 1) seems to be equal to it's previous value, even if the print returns the correct window size (1920px). A second click to Restore Down will then set the padding to the value we should have when we maximized it.

I don't really get what's happening here, I must be missing something... Tell me if you need more information such as more code.
Thank you for your kind help :)