> In your example code, do you see the error raised only when you
> include the tight_layout call?

Yes.  To see this (at least on my platform), you take the example code
and try two things:

1) Comment IN this line: self.panel.Layout().  Run it and you'll get the error.
3) Now comment OUT the tight_layout() call.  Run it and you won't get the error.

So you have to Layout() a parent panel (the one the canvas is sitting
on) for this error to occur, but that is a common thing to do in
wxPython when using sizers and shouldn't cause errors.  Here is the
traceback:

Traceback (most recent call last):
  File "C:\Documents and
Settings\user\Desktop\testing_tight_layout.py", line 35, in <module>
    frame = Frame1(None)
  File "C:\Documents and
Settings\user\Desktop\testing_tight_layout.py", line 14, in __init__
    self.Add_MPL_Plot()
  File "C:\Documents and
Settings\user\Desktop\testing_tight_layout.py", line 30, in
Add_MPL_Plot
    self.figure.tight_layout()
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line
1393, in tight_layout
    self.subplots_adjust(**kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line
1218, in subplots_adjust
    self.subplotpars.update(*args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 183, in update
    raise ValueError('left cannot be >= right')
ValueError: left cannot be >= right

I just don't understand what this means and why it would be thrown.

> Anyhow, your code runs fine in my installment, linux + python 2.7.2 +
> wxgtk 2.8.11.0 + mpl master branch.
> On which platform you're running this?

WinXP, Python 2.5, wxPython 2.8.10.1 (msw-unicode), mpl 1.1.0 as
downloaded from the site three days ago.

When you say the code runs fine, did you try steps (1) and (2) above?
Also, if you just run it without making those changes, does the
tight_layout() work to resize the plot such that it allows the axis
labels to be seen at all times?  (it doesn't for me).

So, to summarize:

- Error if I call self.panel.Layout() before I call tight_layout().
- If I don't do this, no error, but it still isn't doing a proper tight layout.

Thanks,
Che

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to