You can use the below-mentioned code if you want to change the figure that is drawn with Matplotlib:
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)
Now if you need to propagate the size change to an already existing GUI window, then add 'forward=True'
fig.set_size_inches(18.5, 10.5, forward=True)
You can use the following video tutorials to clear all your doubts:-