wx backend scaling problem

The attached test.py produces the attached png files with the Agg and WXAgg backends respectively. I've just started using the latest Enthought all-in-one beta which ships with matplotlib 0.91.2 and defaults to using WXAgg rather than TkAgg, so I've only just noticed this behaviour. I edited rcsetup.py, making the changes described in <http://www.nabble.com/Re%3A-pylab-axis-query-and-possible-bug-p14459682.html> to enable this to run.

The other backends I was able to test (PDF, PS, SVG, TkAgg) all produce correct output (same as test_Agg.png), so the scaling problem seems looks like it's specific to WXAgg.

Gary R.

test_Agg.png

test_WXAgg.png

Gary Ruben wrote:

The attached test.py

Oops. Here it is.
Gary R.

test.py (553 Bytes)

Well, that was a good puzzle!

It turns out that in the Wx backends, the figure is created at the correct (requested) size, and then immediately the height is shrunk by 25 pixels (at least on my platform) when the status bar is added to the window. By creating the status bar before the figure canvas I was able to prevent this from happening.

This seems like a safe fix to me, but anyone who currently extends the Wx Frame (meaning the whole window etc.) and is unknowingly compensating for this effect may have problems after my change.

Committed on the maintenance branch in r4997.

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=rev&revision=4997

BTW, I also committed the fix for the range of values in figure.subplot.* here:

<http://www.nabble.com/Re%3A-pylab-axis-query-and-possible-bug-p14459682.html>

to the maintenance branch (it was previously only made to the trunk.)

Cheers,
Mike

Gary Ruben wrote:

ยทยทยท

Gary Ruben wrote:

The attached test.py

Oops. Here it is.
Gary R.
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi Michael,

Michael Droettboom wrote:

Well, that was a good puzzle!

Glad I got your neurons firing.

This seems like a safe fix to me, but anyone who currently extends the Wx Frame (meaning the whole window etc.) and is unknowingly compensating for this effect may have problems after my change.

Many thanks for looking at this. I applied your fix and it works for me.

Gary R.