How to maximaze a Tkinter window


I would like to maximize a window that is generated by pyplot.

Example code:

import numpy as np
import matplotlib.pyplot as plt

t = np.arange(0., 5., 0.2)
line, = plt.plot(t, t**2, 'bo')

I found code on how to do this in Tkinter mailing:

def maximize_toplevel( widget ):
     toplevel = root.winfo_toplevel()

         # On MS Windows one can set the "zoomed" state.
         toplevel.wm_state( 'zoomed' )
         w = root.winfo_screenwidth()
         h = root.winfo_screenheight() - 60

         geom_string = "%dx%d+0+0" % (w,h)
         toplevel.wm_geometry( geom_string )

But I have no clue how to apply this in the pyplot environment. In other words, how do I get from the call to something that can be passed to the maximize_toplevel function?

Thanks for any hint