[Matplotlib-users] easy_install basemap

2008-02-06 Thread Lionel Roubeyrie
Hi all,
don't sure it's the best way, but I have tried to install basemap via 
easy_install. the installation works fine (after a export GEOS_DIR), but it 
impossible to import it :-( Is there a special manipulation to get it 
working?
Thanks
-- 
Lionel Roubeyrie - [EMAIL PROTECTED]
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] easy_install basemap

2008-02-06 Thread Jeff Whitaker
Lionel Roubeyrie wrote:
> Hi all,
> don't sure it's the best way, but I have tried to install basemap via 
> easy_install. the installation works fine (after a export GEOS_DIR), but it 
> impossible to import it :-( Is there a special manipulation to get it 
> working?
> Thanks
>   
Lionel:  Basemap can't be installed as an egg because it exists as a 
subpackage of matplotlib.  In order for that to work properly, the 
toolkits have to be "namespace packages".  This is fixed in svn for both 
matplotlib and basemap, so when the next version of matplotlib is 
released, I'll release a new basemap that can be installed as an egg.  
It will require some changes in your code though.  Specifically, to 
import basemap you will need to do

from mpl_toolkits.basemap import Basemap

instead of

from matplotlib.toolkits.basemap import Basemap.

-Jeff

-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1FAX   : (303)497-6449
325 BroadwayBoulder, CO, USA 80305-3328


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] subplot inside subplot

2008-02-06 Thread Vinu Vikram
Hi All
I have a figure of six subplot. I want to make one subplot in such a way
that  I have to plot two data set with common x-axis with the bottom plot is
30% of  the subplot and the upper plot is 70% of the subplot. How can I do
that? I tried

x = arange(10)
y=sin(x)
z=cos(y)
rect1 = [0.1, 0.1, 0.8, 0.2]
rect2 = [0.1, 0.3, 0.8, 0.5]
axUpper=axes(rect2)
axLower=axes(rect1)
axUpper.plot(x,y)
axLower.plot(x,z)

But how can I do this in a subplot?


Thanks
Vinu V
-- 
VINU VIKRAM
http://iucaa.ernet.in/~vvinuv/
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to stop legend from obscuring plot?

2008-02-06 Thread chombee
On Tue, 2008-02-05 at 15:20 -0600, John Hunter wrote:
> On Feb 5, 2008 2:17 PM, chombee <[EMAIL PROTECTED]> wrote:
> > Could anyone advise me or give me an example of how to prevent a legend
> > from obscuring a plot, or how I could do this better:
> >
> > http://www.23hq.com/seanh/photo/2862125/view-large
> >
> > I tried moving the legend out of the way using (x,y) coords but if I
> > move it out of the axes viewport it also moves out of the figure, and it
> > looks silly anyway. I also tried increasing the limits of the axes
> > beyond those of the data, but that looked silly too. And I tried to
> > change the font size of the legend but couldn't get it to work.
> 
> You could use custom axes (rather than subplots) and a figlegend, eg
> 
> http://matplotlib.sf.net/examples/figlegend_demo.py
> 
> JDH

Thanks for that. Once I also rounded my statistical results using
builtin round it worked perfectly:

http://img215.imageshack.us/img215/7664/figure1pr2.png



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] subplot inside subplot

2008-02-06 Thread John Hunter
On Feb 6, 2008 7:51 AM, Vinu Vikram <[EMAIL PROTECTED]> wrote:
> Hi All
> I have a figure of six subplot. I want to make one subplot in such a way
> that  I have to plot two data set with common x-axis with the bottom plot is
> 30% of  the subplot and the upper plot is 70% of the subplot. How can I do
> that? I tried
>
> x = arange(10)
> y=sin(x)
> z=cos(y)
> rect1 = [0.1, 0.1, 0.8, 0.2]
> rect2 = [0.1, 0.3, 0.8, 0.5]
> axUpper=axes(rect2)
> axLower=axes(rect1)
> axUpper.plot(x,y)
> axLower.plot(x,z)
>
> But how can I do this in a subplot?

You can do this with 'axes', but not with 'subplot'.  subplot is just
a special case of axes where the assumption is that the axes lie on a
regular grid.

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Offset details for contour plot

2008-02-06 Thread Dan Karipides
I'm considering using Matplotlib to programmatically generate images for a
web-based application.  I want some specific information about contour plot
images produced by Matplotlib and I was wondering if it was easy/possible to
get this information.

 

Imagine a contour plot rendered to a .png.  For simplicity, assume the size
is 1000x1000 pixels.  Of course, this image has white-space, axes, axis
labels, perhaps a colorbar, etc.  The actual contour part, showing the data,
is smaller than 1000x1000 pixels.  I'd like to know:

 

*   the size (in pixels) of the actual contour part of the generated
.png

*   the offset (in pixels) from the bottom left hand corner of the
actual contour part

 

Of course if pixel information isn't possible, offset and size as a
percentage of the total image size would be fine.

 

Thanks,

 

-Dan

---

Dan Karipides

[EMAIL PROTECTED]

 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plot a complex sequence (newb)

2008-02-06 Thread Neal Becker
Newb here.  I can plot a seq of float with:

pylab.plot (s)
pylab.show()

But if s is complex, say numpy.array(complex), it doesn't do what I want.  I
think it's just showing the real part?

I want to get 2 line graphs, one real one imag.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] draft solution to overlapping dates problem

2008-02-06 Thread John Hunter
On Feb 6, 2008 2:33 PM, John Harrison <[EMAIL PROTECTED]> wrote:
> I don't know if this is helpful or not, but I've seen some complaints
> in the archives about a problem that I've been facing, so I thought
> I'd post my solution.


Have you tried

   fig.autofmt_xdate()

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] draft solution to overlapping dates problem

2008-02-06 Thread John Harrison
I don't know if this is helpful or not, but I've seen some complaints  
in the archives about a problem that I've been facing, so I thought  
I'd post my solution.

I am auto-generating graphs of weekly data.  In terms of pixels the  
graphs will always be the same size, but the number of weeks included  
can vary from a single week to two year's worth of data.  For many of  
these graphs matplotlib does a fine job of placing ticks in a helpful  
and readable manner.  But for some situations where I have say, six  
weeks of data, it places ticks every few days in such a way that they  
overlap and are unreadable.

The MaxNLocator is helpful in this situation as I can use it to limit  
the number of ticks, but it isn't ideal because I really only want  
the first day of the week labeled, not some arbitrary location in the  
middle of the weeks.  So I can up with the following locator that  
will place a limited number of labels at places along the axis that  
make sense.  You pass it the max number of bins and the width of the  
data.  So for my needs I give it 6 bins and a width of 7 for weekly  
data.  If there are fewer dates then it only labels the start of each  
week, not days in between.  It there are more weeks than that it  
tries to group them into 6 or fewer bins.  I've done some testing and  
it works well for me.


class MaxNDateLocator(Locator):
 def __init__(self, num_bins, item_width):
 self.bins = num_bins
 self.width = item_width

 def __call__(self):
 self.verify_intervals()
 vmin, vmax = self.dataInterval.get_bounds()
 delta = vmax - vmin
 mul = 1
 if (mul*self.bins*self.width < delta):
 mul = int(delta/(self.bins*self.width)) + 1

 return range(vmin,vmax+1,mul*self.width)

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] draft solution to overlapping dates problem

2008-02-06 Thread John Harrison
Yes, but for my purposes the rotated dates don't work.  Also, I  
really don't want dates that don't mark the start of a 7 day period  
to appear.

On Feb 6, 2008, at 10:56 AM, John Hunter wrote:

> On Feb 6, 2008 2:33 PM, John Harrison <[EMAIL PROTECTED]> wrote:
>> I don't know if this is helpful or not, but I've seen some complaints
>> in the archives about a problem that I've been facing, so I thought
>> I'd post my solution.
>
>
> Have you tried
>
>fig.autofmt_xdate()
>
> JDH


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users