[Matplotlib-users] xlabel cut off in the example embeding_in_qt4.py

2012-01-21 Thread Forest Yang
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

--
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
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xlabel cut off in the example embeding_in_qt4.py

2012-01-21 Thread Forest Yang
On Sat, Jan 21, 2012 at 9:53 PM, Ethan Swint  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
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

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

--
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
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] show legend without box ?

2010-07-01 Thread Forest Yang
Hi All,

 Is there any way to show the legend but without the box ? it is
blocking the figures. Although I can set the alpha to make the legend
transparent, still remove the box and make it transparent would be
better.

Thanks.

Forest.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how to plot contour on a regular grid with mask ?

2010-09-17 Thread Forest Yang
Hi

   I have a function z(x, y) on a regular grid. But some of the value
z are not defined on (x,y). I want to plot the contour or contourf of
z on (x,y) but exclude specific (x,y) points.
How can I do it ? Right now I just draw small colored square
(rectangular) around defined (x,y) the color is not smooth since no
interpolation like contour or contourf.

Thanks.

Forest.

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to plot contour on a regular grid with mask ?

2010-09-18 Thread Forest Yang
Thanks, that works fantastically !

-- Forest.

On Fri, Sep 17, 2010 at 9:23 PM, Benjamin Root  wrote:
> On Fri, Sep 17, 2010 at 8:05 PM, Forest Yang  wrote:
>>
>> Hi
>>
>>   I have a function z(x, y) on a regular grid. But some of the value
>> z are not defined on (x,y). I want to plot the contour or contourf of
>> z on (x,y) but exclude specific (x,y) points.
>> How can I do it ? Right now I just draw small colored square
>> (rectangular) around defined (x,y) the color is not smooth since no
>> interpolation like contour or contourf.
>>
>> Thanks.
>>
>> Forest.
>>
>
> Forest,
>
> There are a few ways to do this.  If you have a recent enough version of
> matplotlib, you can use masked arrays, and the contourf will just ignore
> those data points.  One could also use NaNs and make sure that the clim (the
> limits on z that you wish to display a color for) is defined.
>
> To make a masked array is easy.  Imagine you wish to exclude any value less
> than zero (assume z is defined):
>
> import numpy.ma as ma
> z_masked = ma.masked_array(z, mask=(z < 0.))
>
> And then just use the  masked array in your contourf as you would the
> regular numpy array.
>
> I hope that helps!
> Ben Root
>
>

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] No qt4agg backends running on example file

2011-02-17 Thread Forest Yang
Hi,

 I am using Ubuntu 10.10, and installed matplotlib from the
repository. But when running an example file embedding plot in Qt4 I
got the following errors:


[11:34 PM] $ python embedding_in_qt4.py
Traceback (most recent call last):
 File "embedding_in_qt4.py", line 16, in 
   from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
as FigureCanvas
ImportError: No module named backends.backend_qt4agg


Any extra steps for installing Qt4Agg backend ?

Thanks !

Best regards,
Forest

--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users