Fix for figsize not being honored in WXAgg & WX - How to contribute?

Greetings. I’ve been using matplotlib for a few weeks now in ipython on Windows XP and with the WXAgg backend. I’m impressed by the breadth of features and the versatility of the package. Thank you for producing such a useful and well-made tool.

I noticed that the figure function was not exactly honoring the figsize argument, as can be seen with

f = figure(figsize=(6, 4)); f.get_size_inches()

which returns approximately (5.9, 3.325) when rcParams[‘figure.dpi’] = 80 and (5.917, 3.4375) when rcParams[‘figure.dpi’] = 96. It seems that the window frame, not the figure, takes on the given size, with some height adjustment related to the status bar or toolbar.

A subsequent call to f.set_size_inches will correctly set the stored size of the figure but not its displayed size. The set_size_inches method has a mechanism for forwarding the new size to the window, but, according to the docstring, that mechanism works only in the GTK backend.

I believe I have (1) a fix that gives new figures the size specified by figsize, and (2) an implementation of the forward mechanism for set_size_inches. I believe these apply to both WXAgg and WX. I’d like to contribute them to the package; how do I do so?

You can post your patch here and also on the patches section of the
website. If it is not taken care of within a few days, send us a
gentle reminder.

JDH

···

On Wed, May 21, 2008 at 8:10 AM, Stan West <stan.west@...595...> wrote:

I believe I have (1) a fix that gives new figures the size specified by
figsize, and (2) an implementation of the forward mechanism for
set_size_inches. I believe these apply to both WXAgg and WX. I'd like to
contribute them to the package; how do I do so?

Thanks, John. Here is the patch for the v0_91_maint branch. As far as I
can tell, analogous changes can be made to the trunk.

Also, I believe that this resolves bug 1287318 for the WX* backends.

fix_figsize_wx.patch (1.83 KB)