Axes changing position while programmatically zooming in/out

Hello list,

I am creating a series of plots automatically. During the first 10 of them, I gradually zoom in to a specific area, while during the last 10 I zoom out to the original axes limits.

The problem is, I am only changing the x/y limits of the axes, not their position. However, when savefig is called on the figure, the actual axes position changes (even thought I specifically give the axes position myself at every iteration).

I am attaching a sample application which demonstrates the problem. This is on Windows 7, Python 2.7.3, WXAgg, Matplotlib 1.2.0. The output I get for the axes bbox is as follow (from the attached script):

Reached date: 01-Jan-2010

Bbox(‘array([[ 0.52953281, 0.062 ],\n [ 0.90046719, 0.93 ]])’)

Reached date: 01-Feb-2010

Bbox(‘array([[ 0.5314989, 0.062 ],\n [ 0.8985011, 0.93 ]])’)

Reached date: 01-Mar-2010

Bbox(‘array([[ 0.53257326, 0.062 ],\n [ 0.89742674, 0.93 ]])’)

Reached date: 01-Apr-2010

Bbox(‘array([[ 0.53371628, 0.062 ],\n [ 0.89628372, 0.93 ]])’)

Reached date: 01-May-2010

Bbox(‘array([[ 0.53493477, 0.062 ],\n [ 0.89506523, 0.93 ]])’)

Reached date: 01-Jun-2010

Bbox(‘array([[ 0.53623645, 0.062 ],\n [ 0.89376355, 0.93 ]])’)

Reached date: 01-Jul-2010

Bbox(‘array([[ 0.53763013, 0.062 ],\n [ 0.89236987, 0.93 ]])’)

Reached date: 01-Aug-2010

Bbox(‘array([[ 0.53912594, 0.062 ],\n [ 0.89087406, 0.93 ]])’)

Reached date: 01-Sep-2010

Bbox(‘array([[ 0.54073553, 0.062 ],\n [ 0.88926447, 0.93 ]])’)

Reached date: 01-Oct-2010

Bbox(‘array([[ 0.54247238, 0.062 ],\n [ 0.88752762, 0.93 ]])’)

Reached date: 01-Nov-2010

Bbox(‘array([[ 0.54247238, 0.062 ],\n [ 0.88752762, 0.93 ]])’)

Does anyone see what I may be doing wrong?

Thank you in advance for your help.

mpl_sample.py (2.34 KB)

···


Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”
http://www.infinity77.net

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():
    send_message(email)
else:

    install_malware()
    erase_hard_drives()

-------------------------------------------------------------