xlabel cut off in the example embeding_in_qt4.py

Hi,

   I am embedding a plot in Qt4 application, following the matplotlib
example embeding_in_qt4.py, however I found that the xlabel is cut
off, although the label shows more if I resize the window, still it is
not the right one. Is it because of my local parameter settings or
it's the limit of the example code. How can I fix this ?

  Thanks.

Best regards,
Forest Yang

Take a look into pyplot.subplots_adjust - you can specify buffers there as a fraction of the window size, e.g.
pyplot.subplots_adjust(0.155,0.12,0.95,0.9) works well for a 3.5"x3" figure with 8-pt font on the axis labels and tics.

-Ethan

···

On 1/21/2012 9:12 PM, Forest Yang wrote:

Hi,

    I am embedding a plot in Qt4 application, following the matplotlib
example embeding_in_qt4.py, however I found that the xlabel is cut
off, although the label shows more if I resize the window, still it is
not the right one. Is it because of my local parameter settings or
it's the limit of the example code. How can I fix this ?

   Thanks.

Best regards,
Forest Yang

I dashed that last reply off quickly - a more complete answer would address your local parameter settings. In pyplot.rcParams, you can set the default values for a number of parameters. In this case, I believe the parameters that will affect the cropping are the image size and the sizes of the axis labels and tics. I'm fairly new to these items myself - I'm not convinced that changes rcParams will be preserved from one python session to the next.

-Ethan

···

On 1/21/2012 9:12 PM, Forest Yang wrote:

Hi,

    I am embedding a plot in Qt4 application, following the matplotlib
example embeding_in_qt4.py, however I found that the xlabel is cut
off, although the label shows more if I resize the window, still it is
not the right one. Is it because of my local parameter settings or
it's the limit of the example code. How can I fix this ?

   Thanks.

Best regards,
Forest Yang

Thanks. This fig.subplots_adjust(bottom=0.15) works well for me.

I was thinking like TeX/LaTeX, it automatic calculate the space and
overlapping between symbols (treated as boxes, forgot what Knuth call
it).

I used the rcParams before, but sometimes I plot for PPT with larger
fonts, sometimes for article with smaller fonts. the rcParams did not
worked well for me.

Best regards
Forest

···

On Sat, Jan 21, 2012 at 9:53 PM, Ethan Swint <eswint@...3245...> wrote:

On 1/21/2012 9:12 PM, Forest Yang wrote:

Hi,

I am embedding a plot in Qt4 application, following the matplotlib

example embeding_in_qt4.py, however I found that the xlabel is cut
off, although the label shows more if I resize the window, still it is
not the right one. Is it because of my local parameter settings or
it's the limit of the example code. How can I fix this ?

Thanks.

Best regards,
Forest Yang

I dashed that last reply off quickly - a more complete answer would
address your local parameter settings. In pyplot.rcParams, you can set
the default values for a number of parameters. In this case, I believe
the parameters that will affect the cropping are the image size and the
sizes of the axis labels and tics. I'm fairly new to these items myself
- I'm not convinced that changes rcParams will be preserved from one
python session to the next.

-Ethan

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options