From: Giorgio Gilestro <giorgio@gi...> - 2007-02-09 18:26:16
Dear matplotlib users,
I am a new enthusiastic member of the matplotlib community.
I'll start up my frequentation in the ml with two questions for which I
couldn't find an answer; the first one is relatively tricky while the second
one should be quite straigthforward. Both are, I believe, of general
1) I use matplotlib and the wxmpl library to wrap the graphs in a notebook
page of a wxpython application. My canvas is a wxmpl.PlotPanel which is a
derivation of FigureCanvasWxAgg.Everything works just great, I love it.
Thing is that while most graphs have contained size, certain graphs can be
actually composed of several subplots and therefore I would like them to be
plotted on bigger canvas.
I can create a big canvas in a scrolledwindow with big virualsize and this
works just fine.
What I cannot do is to dinamically resize the canvas after it has been
create, ie. Create a smaller canvas and then increase its size only if
One more thing is that if I put the canvas in a sizer and then set the
scrolledwindow to fit the sizer than the canvas changes its dimension
accortding to the dimension of the frame (meaning if I maximize the whole
frame I seem to get a bigger canvas.
Here some graphic examples:
This is what I have now
def _init_ ...
#In the notebook page self, create scrolledwindow
self.virtualw = wx.ScrolledWindow(self)
#Create Canvas, child of the scrolledwindow
self.canvas1 = MyCanvas(self.virtualw)
#now arrange the sizer
self.cs = wx.BoxSizer()
self.cs.Add (self.canvas1, 1, wx.GROW|wx.ALL, 1)
This code will result in this: http://zipp.it/u/Q687P
Note that in the panel I also have a grid and a textbox and some buttons,
all arranged within a sizer.
If I resize the figure using
fig.set_size_inches((10,10)) I get this: http://zipp.it/u/Z466Y
2) Is it possible to include in my subplot a custom drawing?
I would like to have a half filled rectangle below the x axis, like the one
you see on panel b of the figure: http://zipp.it/u/L963V
Thanks a lot,