Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to build a grid of frames in each there is a matplotlib figure. When I resize the window the figure remain with fix size and are not resizing to fit the empty space. Is there a way to make the figure change its size according to the canvas (hopefully that it does change with the window size)?

before expanding the window after expanding the window

This is how I do the embedding in each frame:

self._figure = pyplot.figure(figsize=(4,4))       
self._axes = self._figure.add_subplot(111)
self._canvas = FigureCanvasTkAgg(self._figure, master=self._root)
self._canvas.get_tk_widget().grid(row=1,column=1,rowspan = 4)
share|improve this question
    
If you are doing the embedding correctly, it should behave like any other widget and this is a Tk issue, not an mpl issue. –  tcaswell Sep 7 '13 at 18:08
    
can you please explain? I added above the embedding code –  Hanan Shteingart Sep 8 '13 at 8:52
    
matplotlib.org/examples/user_interfaces <- see examples here –  tcaswell Sep 8 '13 at 15:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.