[Matplotlib-users] changing the cursor position with a key press

2011-08-17 Thread Mathew Yeates
Does anyone have an example showing how to change the cursor position
using the key pad instead of the mouse?


-Mathew

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] changing the cursor position with a key press

2011-08-17 Thread Mathew Yeates
I'm looking for something like
-
display = gdk_display_get_default ();
screen = gdk_display_get_default_screen (display);

/* get cursor position */
gdk_display_get_pointer (display, NULL, x, y, NULL);

/* set new cusor position */
x += xadd;
y += yadd;
gdk_display_warp_pointer (display, screen, x, y);

On Wed, Aug 17, 2011 at 11:52 PM, Benjamin Root ben.r...@ou.edu wrote:


 On Wednesday, August 17, 2011, Mathew Yeates mat.yea...@gmail.com wrote:
 Does anyone have an example showing how to change the cursor position
 using the key pad instead of the mouse?


 -Mathew


 Are you talking about externally to mpl or within mpl?  I have some code
 from a couple of months ago that automated graph interaction that allowed me
 to exactly reproduce various actions so I could profile the execution.

 It uses the Gtk accessibility framework to control the mouse.

 Ben Root

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] changing the cursor position with a key press

2011-08-17 Thread Mathew Yeates
Here is how to do it
display=mainwindow.get_display()
screen = gtk.gdk.Display.get_default_screen(display)
x,y=mainwindow.get_pointer()
s,x,y,m = display.get_pointer()
gtk.gdk.Display.warp_pointer(display, screen,x+1,y)

On Wed, Aug 17, 2011 at 11:53 PM, Mathew Yeates mat.yea...@gmail.com wrote:
 I'm looking for something like
 -
 display = gdk_display_get_default ();
    screen = gdk_display_get_default_screen (display);

    /* get cursor position */
    gdk_display_get_pointer (display, NULL, x, y, NULL);

    /* set new cusor position */
    x += xadd;
    y += yadd;
    gdk_display_warp_pointer (display, screen, x, y);

 On Wed, Aug 17, 2011 at 11:52 PM, Benjamin Root ben.r...@ou.edu wrote:


 On Wednesday, August 17, 2011, Mathew Yeates mat.yea...@gmail.com wrote:
 Does anyone have an example showing how to change the cursor position
 using the key pad instead of the mouse?


 -Mathew


 Are you talking about externally to mpl or within mpl?  I have some code
 from a couple of months ago that automated graph interaction that allowed me
 to exactly reproduce various actions so I could profile the execution.

 It uses the Gtk accessibility framework to control the mouse.

 Ben Root


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] changing the cursor position with a key press

2011-08-17 Thread Mathew Yeates
cool,

On Wed, Aug 17, 2011 at 5:15 PM, Benjamin Root ben.r...@ou.edu wrote:
 On Wed, Aug 17, 2011 at 7:01 PM, Mathew Yeates mat.yea...@gmail.com wrote:

 Here is how to do it
    display=mainwindow.get_display()
    screen = gtk.gdk.Display.get_default_screen(display)
    x,y=mainwindow.get_pointer()
    s,x,y,m = display.get_pointer()
    gtk.gdk.Display.warp_pointer(display, screen,x+1,y)


 Ok, glad that works for you.  For reference, the email I was referring to is
 here:

 http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg08321.html

 The toolkit offers a bunch of other tools for scripting out interaction, in
 case anybody cares about that sort of thing. (actually, might be a good idea
 to consider adding stuff like that to the testing suite...)

 Ben Root



--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] determining of a line segment is a Line2D

2011-08-15 Thread Mathew Yeates
Hi
Is there a simple way to do the following

l1=Line2D(xdata=[1,2,3],ydata=[4,5,6])

l2=Line2D(xdata = [1].ydata=[3])

if l2 in l1 #error, Line2D not iterable


-Mathew

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] handling pick events doesn't work for me

2011-07-12 Thread Mathew Yeates
Hi
I have a GTK application with the code

def on_pick(event):
print on_pick
thisline = event.artist
xdata, ydata = thisline.get_data()
ind = event.ind
print 'on pick line:', zip(xdata[ind], ydata[ind])

cid = fig.canvas.mpl_connect('pick_event', on_pick)

but the routine never gets called when I click the left mouse button.
Instead,  the FigureCanvas pick method is called.
What am I doing wrong??

-Mathew

--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on Lean Startup 
Secrets Revealed. This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] removing lines from plot

2011-05-04 Thread Mathew Yeates
Hi
I've added some lines with
ax.add_line(yellowlines)
ax.add_line(redlines)

how can I remove the lines without completely redrawing everything?


-Mathew

--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3d navigation with zoom and rotate

2011-04-13 Thread Mathew Yeates
Hi

Has anyone ever added this capability? I want to be able to rotate a
projection of the earth.

Thanks
Mathew

--
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Why can't I change my artist's alpha?

2010-08-16 Thread Mathew Yeates
Hi
I want my plot to be visible when I display some text over it. Why
doesn't this work?
fig = plt.figure(figsize=(5,5), dpi=100)
ax=fig.add_axes([0.1,0.1,0.8,.8])
ax.hist(data)
box1 = TextArea(Minimum: %f % mind, textprops=dict(color=k))
box2 = TextArea(Maximum: %f % maxd, textprops=dict(color=k))
box = VPacker(children=[box1,box2],
  align=center,
  pad=0, sep=5)
anchored_box = AnchoredOffsetbox(loc=3,
 child=box, pad=0.,
 frameon=True,
 bbox_to_anchor=(0.8, 0.72),
 bbox_transform=ax.transAxes,
 borderpad=0.,
 )


art=ax.add_artist(anchored_box)
art.set_alpha(0.5)

-Mathew

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why can't I change my artist's alpha?

2010-08-16 Thread Mathew Yeates
Thanks, Ben, but I figured out that I just needed to use
frameon=False. This way, I can see teh plot under the text.

Thx

On Mon, Aug 16, 2010 at 9:16 AM, Benjamin Root ben.r...@ou.edu wrote:
 On Mon, Aug 16, 2010 at 10:59 AM, Mathew Yeates mat.yea...@gmail.com
 wrote:

 Hi
 I want my plot to be visible when I display some text over it. Why
 doesn't this work?
 fig = plt.figure(figsize=(5,5), dpi=100)
 ax=fig.add_axes([0.1,0.1,0.8,.8])
 ax.hist(data)
 box1 = TextArea(Minimum: %f % mind, textprops=dict(color=k))
 box2 = TextArea(Maximum: %f % maxd, textprops=dict(color=k))
 box = VPacker(children=[box1,box2],
              align=center,
              pad=0, sep=5)
 anchored_box = AnchoredOffsetbox(loc=3,
                                 child=box, pad=0.,
                                 frameon=True,
                                 bbox_to_anchor=(0.8, 0.72),
                                 bbox_transform=ax.transAxes,
                                 borderpad=0.,
                                 )


 art=ax.add_artist(anchored_box)
 art.set_alpha(0.5)

 -Mathew


 Mathew,

 Could you please include a completely self-contained version of the script
 for us to try out?  Plus, which version of matplotlib are you using?

 Ben Root



--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
why doesn't this work?
xs=[0,0,8,8]
ys=[0,8,8,0]
verts=zip(xs,ys)
poly = PolyCollection(verts)


I tried
poly = PolyCollection([verts]) but that doesn't work either

-Mathew

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
I installed matplotlib 1.0 and now I get a different error
s=[0,0,8,8]
ys=[0,8,8,0]
verts=zip(xs,ys)
poly = PolyCollection(verts)

fails at line 587 in collections because
xy = array([0, 0]) # xy.shape = (2,)
and line 587 says xy = np.concatenate([xy, np.zeros((1,2))])

What do I do?

-Mathew


On Tue, Jul 27, 2010 at 9:51 AM, Mathew Yeates mat.yea...@gmail.com wrote:
 why doesn't this work?
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)


 I tried
 poly = PolyCollection([verts]) but that doesn't work either

 -Mathew


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
I still get the error
ValueError: arrays must have same number of dimensions
at line 587 in collections.py

This is on Windows.


On Tue, Jul 27, 2010 at 11:42 AM, Eric Firing efir...@hawaii.edu wrote:
 On 07/27/2010 08:14 AM, Mathew Yeates wrote:
 I installed matplotlib 1.0 and now I get a different error
 s=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)

 fails at line 587 in collections because
 xy = array([0, 0]) # xy.shape = (2,)
 and line 587 says xy = np.concatenate([xy, np.zeros((1,2))])

 What do I do?

 With 1.0:

 In [8]: verts
 Out[8]: [(0, 0), (0, 8), (8, 8), (8, 0)]

 In [9]: p = PolyCollection([verts])

 Eric


 -Mathew


 On Tue, Jul 27, 2010 at 9:51 AM, Mathew Yeatesmat.yea...@gmail.com  wrote:
 why doesn't this work?
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)


 I tried
 poly = PolyCollection([verts]) but that doesn't work either

 -Mathew


 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
I tried
xs=[0,0,8,8]
ys=[0,8,8,0]
verts=zip(xs,ys)
poly = PolyCollection([verts])

already but it doesn't work

on line 581 of collections.py

there is
for xy in verts:

but
verts=[[(0, 0), (0, 8), (8, 8), (8, 0)]] i.e. a list with a single element.
so the loop  happens only once

-Mathew


On Tue, Jul 27, 2010 at 12:29 PM, Eric Firing efir...@hawaii.edu wrote:
 On 07/27/2010 08:55 AM, Mathew Yeates wrote:

 I still get the error
 ValueError: arrays must have same number of dimensions
 at line 587 in collections.py

 I think you are not actually doing what you think you are doing, and what
 was explained by Tony.

 Try the attached script.

 Eric


 This is on Windows.


 On Tue, Jul 27, 2010 at 11:42 AM, Eric Firingefir...@hawaii.edu  wrote:

 On 07/27/2010 08:14 AM, Mathew Yeates wrote:

 I installed matplotlib 1.0 and now I get a different error
 s=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)

 fails at line 587 in collections because
 xy = array([0, 0]) # xy.shape = (2,)
 and line 587 says xy = np.concatenate([xy, np.zeros((1,2))])

 What do I do?

 With 1.0:

 In [8]: verts
 Out[8]: [(0, 0), (0, 8), (8, 8), (8, 0)]

 In [9]: p = PolyCollection([verts])

 Eric


 -Mathew


 On Tue, Jul 27, 2010 at 9:51 AM, Mathew Yeatesmat.yea...@gmail.com
  wrote:

 why doesn't this work?
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)


 I tried
 poly = PolyCollection([verts]) but that doesn't work either

 -Mathew

 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
your code works fine. But I thought it wasnt working because when I do
zs=[0,0.1,0.2,0.3]
#pdb.set_trace()
poly = PolyCollection([verts])
ax.add_collection3d(poly,zs=zs)

I just get a flat plane.

On Tue, Jul 27, 2010 at 12:50 PM, Eric Firing efir...@hawaii.edu wrote:
 On 07/27/2010 09:43 AM, Mathew Yeates wrote:
 I tried
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection([verts])

 already but it doesn't work

 Yes, I saw you say that, but---did you actually try running the script I
 attached?

 Please run it from the command line (python pctest.py), and if it
 fails, send the traceback.

 Eric


 on line 581 of collections.py

 there is
 for xy in verts:

 but
 verts=[[(0, 0), (0, 8), (8, 8), (8, 0)]] i.e. a list with a single element.
 so the loop  happens only once

 -Mathew


 On Tue, Jul 27, 2010 at 12:29 PM, Eric Firingefir...@hawaii.edu  wrote:
 On 07/27/2010 08:55 AM, Mathew Yeates wrote:

 I still get the error
 ValueError: arrays must have same number of dimensions
 at line 587 in collections.py

 I think you are not actually doing what you think you are doing, and what
 was explained by Tony.

 Try the attached script.

 Eric


 This is on Windows.


 On Tue, Jul 27, 2010 at 11:42 AM, Eric Firingefir...@hawaii.edu    wrote:

 On 07/27/2010 08:14 AM, Mathew Yeates wrote:

 I installed matplotlib 1.0 and now I get a different error
 s=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)

 fails at line 587 in collections because
 xy = array([0, 0]) # xy.shape = (2,)
 and line 587 says xy = np.concatenate([xy, np.zeros((1,2))])

 What do I do?

 With 1.0:

 In [8]: verts
 Out[8]: [(0, 0), (0, 8), (8, 8), (8, 0)]

 In [9]: p = PolyCollection([verts])

 Eric


 -Mathew


 On Tue, Jul 27, 2010 at 9:51 AM, Mathew Yeatesmat.yea...@gmail.com
   wrote:

 why doesn't this work?
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)


 I tried
 poly = PolyCollection([verts]) but that doesn't work either

 -Mathew

 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PolyCollection API

2010-07-27 Thread Mathew Yeates
My bad. Since I wanted to draw a plane, I thought I wanted to use a
polygon. Instead, using plot_surface I get what I want.

-Mathew

On Tue, Jul 27, 2010 at 1:40 PM, Mathew Yeates mat.yea...@gmail.com wrote:
 your code works fine. But I thought it wasnt working because when I do
 zs=[0,0.1,0.2,0.3]
 #pdb.set_trace()
 poly = PolyCollection([verts])
 ax.add_collection3d(poly,zs=zs)

 I just get a flat plane.

 On Tue, Jul 27, 2010 at 12:50 PM, Eric Firing efir...@hawaii.edu wrote:
 On 07/27/2010 09:43 AM, Mathew Yeates wrote:
 I tried
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection([verts])

 already but it doesn't work

 Yes, I saw you say that, but---did you actually try running the script I
 attached?

 Please run it from the command line (python pctest.py), and if it
 fails, send the traceback.

 Eric


 on line 581 of collections.py

 there is
 for xy in verts:

 but
 verts=[[(0, 0), (0, 8), (8, 8), (8, 0)]] i.e. a list with a single element.
 so the loop  happens only once

 -Mathew


 On Tue, Jul 27, 2010 at 12:29 PM, Eric Firingefir...@hawaii.edu  wrote:
 On 07/27/2010 08:55 AM, Mathew Yeates wrote:

 I still get the error
 ValueError: arrays must have same number of dimensions
 at line 587 in collections.py

 I think you are not actually doing what you think you are doing, and what
 was explained by Tony.

 Try the attached script.

 Eric


 This is on Windows.


 On Tue, Jul 27, 2010 at 11:42 AM, Eric Firingefir...@hawaii.edu    
 wrote:

 On 07/27/2010 08:14 AM, Mathew Yeates wrote:

 I installed matplotlib 1.0 and now I get a different error
 s=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)

 fails at line 587 in collections because
 xy = array([0, 0]) # xy.shape = (2,)
 and line 587 says xy = np.concatenate([xy, np.zeros((1,2))])

 What do I do?

 With 1.0:

 In [8]: verts
 Out[8]: [(0, 0), (0, 8), (8, 8), (8, 0)]

 In [9]: p = PolyCollection([verts])

 Eric


 -Mathew


 On Tue, Jul 27, 2010 at 9:51 AM, Mathew Yeatesmat.yea...@gmail.com
   wrote:

 why doesn't this work?
 xs=[0,0,8,8]
 ys=[0,8,8,0]
 verts=zip(xs,ys)
 poly = PolyCollection(verts)


 I tried
 poly = PolyCollection([verts]) but that doesn't work either

 -Mathew

 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] rotating 3d axis

2010-07-26 Thread Mathew Yeates
Hi
Is there any way to let the user rotate a 3D plot? I don't see an
example which does this.

-Mathew

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fit a plane to a set of xyz points

2010-07-26 Thread Mathew Yeates
Is there a simple function call for this? And finding the distance of
a point to the plane?

-Mathew

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] projection question

2010-05-26 Thread Mathew Yeates
Hi
This probably belongs in Proj mailing list, but .

I want to specify a line/sample horizontal/vertical tile in a 1 Km
resolution sinusoidal projection and get back a lat/lon.

Anyone know how to do this?

Mathew
--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How can I prevent a FigureCanvas from being resized?

2010-04-26 Thread Mathew Yeates
Hi
In an embedded application, I want to have a number of FigureCanvas s inside
a scrolled window. But the FigureCanvas s always resize to fit inside my
main window. I've tried intercepting resize requests but nothing seems to
work. Any ideas?


Mathew
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] multiple canvases, one Navigation Toolbar

2010-04-19 Thread Mathew Yeates
Hi

I want to have a single Navigation Toolbar that lets me do things like
 .. Zoom to rect in one figure and see this change in all figures.

Anybody think this can be done? Any thoughts?

Mathew
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] multiple canvases, one Navigation Toolbar

2010-04-19 Thread Mathew Yeates
Will this work for multiple figures?

On 4/19/10, Ryan May rma...@gmail.com wrote:
 On Mon, Apr 19, 2010 at 4:55 PM, Mathew Yeates mat.yea...@gmail.com wrote:
 Hi
 I want to have a single Navigation Toolbar that lets me do things like
  .. Zoom to rect in one figure and see this change in all figures.
 Anybody think this can be done? Any thoughts?

 You can have the plots share axes, look here:

 http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html

 Ryan

 --
 Ryan May
 Graduate Research Assistant
 School of Meteorology
 University of Oklahoma


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] is this a bug?

2010-04-09 Thread Mathew Yeates
Can anyone verify this? If so, I'll submit it to the tracker.

The following works without the --pylab switch but not with it. The error I
get is some how related to a call to get the active figure  which returns
None.

C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.pyc in
set_axes_limi
ts(self, ax)
   2531 if is_interactive():
   2532 figManager = _pylab_helpers.Gcf.get_active()
- 2533 figManager.canvas.draw()

AttributeError: 'NoneType' object has no attribute 'canvas'.

In the following code. the error happens at
m.drawcoastlines()

Help?

===
from mpl_toolkits.basemap import Basemap, shiftgrid
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_gtkagg import \
FigureCanvasGTKAgg as FigureCanvas
import gtk

# create new figure
#fig=plt.figure()
from matplotlib.figure import Figure
fig = Figure(figsize=(5,5), dpi=100)
canvas = FigureCanvas(fig)
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.add(canvas)
# setup cylindrical equidistant map projection (global domain).
ax = fig.add_axes([0.1,0.1,0.7,0.7])
m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\
resolution='c',area_thresh=1.,projection='cyl',ax=ax)
m.drawcoastlines()
m.tissot(-117,34,10,10)
#plt.show()
canvas.show()
window.show()
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] can't interact with embedded gtk

2010-04-08 Thread Mathew Yeates
The following works without the --pylab switch but not with it. The error I
get is some how related to a call to get the active figure  which returns
None.

C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.pyc in
set_axes_limi
ts(self, ax)
   2531 if is_interactive():
   2532 figManager = _pylab_helpers.Gcf.get_active()
- 2533 figManager.canvas.draw()

AttributeError: 'NoneType' object has no attribute 'canvas'.

In the following code. the error happens at
m.drawcoastlines()

Help?

===
from mpl_toolkits.basemap import Basemap, shiftgrid
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_gtkagg import \
FigureCanvasGTKAgg as FigureCanvas
import gtk

# create new figure
#fig=plt.figure()
from matplotlib.figure import Figure
fig = Figure(figsize=(5,5), dpi=100)
canvas = FigureCanvas(fig)
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.add(canvas)
# setup cylindrical equidistant map projection (global domain).
ax = fig.add_axes([0.1,0.1,0.7,0.7])
m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\
resolution='c',area_thresh=1.,projection='cyl',ax=ax)
m.drawcoastlines()
m.tissot(-117,34,10,10)
#plt.show()
canvas.show()
window.show()
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] display a filled lat/lon basemap rectangle.

2010-04-07 Thread Mathew Yeates
I think this will only work with some projections but not all. I looked at
the code for tissot. It's pretty hairy but it almost does what I want. (It
draws projected circles
instead of projected  rectangles.


On Wed, Apr 7, 2010 at 1:54 PM, Jeff Whitaker jsw...@fastmail.fm wrote:

 Yeates, Mathew C (388D) wrote:
 
 
 
  Hi
 
  What is the simplest way to fill  in a 1 degree by 1 degree rectangle
  on a basemap projection?
 
 
 
  Mathew
 

 Mathew:  Try this (for a 10x10 rectangle, but you get the idea)

 from matplotlib.patches import Polygon
 import matplotlib.pyplot as plt
 from mpl_toolkits.basemap import Basemap
 map = Basemap(projection='moll',lon_0=0)
 x1,y1 = map(-10,-10)
 x2,y2 = map(-10,10)
 x3,y3 = map(10,10)
 x4,y4 = map(10,-10)
 p = Polygon([(x1,y1),(x2,y2),(x3,y3),(x4,y4)],\
facecolor='red',edgecolor='blue',linewidth=2)
 plt.gca().add_patch(p)
 map.drawcoastlines()
 map.drawmapboundary()
 plt.show()

 -Jeff
 



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] display a filled lat/lon basemap rectangle.

2010-04-07 Thread Mathew Yeates
lets say I want  to shade the area with lat/lon corners 34.-117  and 35,-116

but my map was created with projection='aeqd'

The shade area will not be a rectangle. In fact the edges will be curved.
See the basemap code for tissot. I think every point on the boundary of
the lat/lon box has to projected to a line segment.  The collection of
resulting segments forms an irregular polygon.

Mathew



On Wed, Apr 7, 2010 at 6:24 PM, Jeff Whitaker jsw...@fastmail.fm wrote:

 Mathew Yeates wrote:

 I think this will only work with some projections but not all. I looked at
 the code for tissot. It's pretty hairy but it almost does what I want. (It
 draws projected circles
 instead of projected  rectangles.

 Mathew:

 You said you wanted a NxN degree polygon - that's what I gave you.  What
 exactly do you want?  A rectangle in map projection coordinates?  A
 rectangle in lat/lon coordinates?  A circle?

 -Jeff



 On Wed, Apr 7, 2010 at 1:54 PM, Jeff Whitaker jsw...@fastmail.fmmailto:
 jsw...@fastmail.fm wrote:

Yeates, Mathew C (388D) wrote:



 Hi

 What is the simplest way to fill  in a 1 degree by 1 degree
rectangle
 on a basemap projection?



 Mathew


Mathew:  Try this (for a 10x10 rectangle, but you get the idea)

from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
map = Basemap(projection='moll',lon_0=0)
x1,y1 = map(-10,-10)
x2,y2 = map(-10,10)
x3,y3 = map(10,10)
x4,y4 = map(10,-10)
p = Polygon([(x1,y1),(x2,y2),(x3,y3),(x4,y4)],\
   facecolor='red',edgecolor='blue',linewidth=2)
plt.gca().add_patch(p)
map.drawcoastlines()
map.drawmapboundary()
plt.show()

-Jeff




  
 --
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] manual placement of a colorbar

2010-04-01 Thread Mathew Yeates
This doesn't work for what I'm doing. Unless I call contour or something
similar, this will fail. I am only using m.plot and this doesn't set things
up properly to call colorbar.



On Thu, Apr 1, 2010 at 12:40 PM, Jeff Whitaker jsw...@fastmail.fm wrote:

 On 4/1/10 1:24 PM, Mathew Yeates wrote:

 Hi

 I have a Basemap and I want to manually add a colorbar to the side. As you
 can see in the attached image, the colorbar is not correctly positioned.

 Here is a snippet of code

 ax=fig.add_axes([0.1,0.1,0.8,.8])
 m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax)

 cax = fig.add_axes([0.9, 0.1, 0.1, 0.8]) # setup colorbar axes.
 cmap = mpl.cm.cool
 norm = mpl.colors.Normalize(vmin=5, vmax=10)
 cb1 = mpl.colorbar.ColorbarBase(cax, cmap=cmap,
   norm=norm,
   orientation='vertical')

 what am I doing wrong?

 Mathew

 Nothing.  You just have to tweak the cax parameters to get it positioned
 where you want it.

 A quick and dirty approach would be to let matplotlib position the colorbar
 by using

 import matplotlib.pyplot as plt

 plot stuff on basemap

 plt.colorbar(orientation='vertical',shrink=0.5)  # play with the shrink
 param to get it to be the same size as the map

 -Jeff


 --
 Jeffrey S. Whitaker Phone  : (303)497-6313
 Meteorologist   FAX: (303)497-6449
 NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
 325 BroadwayOffice : Skaggs Research Cntr 1D-113
 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] manual placement of a colorbar

2010-04-01 Thread Mathew Yeates
Thanks a bunch JJ. I've been trying to figure that one out all day!

Mathew

On Thu, Apr 1, 2010 at 1:04 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote:

 If you're not afraid of contaminating your code with axes_grid toolkit,

 instead

 cax = fig.add_axes([0.9, 0.1, 0.1, 0.8]) # setup colorbar axes.

 try

 from mpl_toolkits.axes_grid import make_axes_locatable
 import  matplotlib.axes as maxes

 divider = make_axes_locatable(ax)
 cax = divider.new_horizontal(5%, pad=0.05, axes_class=maxes.Axes)
 fig.add_axes(cax)

 This way, the height of the colorbar always matches that of your main axes.

 Regards,

 -JJ


 On Thu, Apr 1, 2010 at 3:24 PM, Mathew Yeates mat.yea...@gmail.com
 wrote:
  Hi
 
  I have a Basemap and I want to manually add a colorbar to the side. As
 you
  can see in the attached image, the colorbar is not correctly positioned.
 
  Here is a snippet of code
 
  ax=fig.add_axes([0.1,0.1,0.8,.8])
  m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax)
 
  cax = fig.add_axes([0.9, 0.1, 0.1, 0.8]) # setup colorbar axes.
  cmap = mpl.cm.cool
  norm = mpl.colors.Normalize(vmin=5, vmax=10)
  cb1 = mpl.colorbar.ColorbarBase(cax, cmap=cmap,
 norm=norm,
 orientation='vertical')
 
  what am I doing wrong?
 
  Mathew
 
 
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] simple example using Basemap in a gtk app??

2010-03-29 Thread Mathew Yeates
I don't understand why the following fails.

fig = Figure(figsize=(5,5), dpi=100)
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax)
m.drawcoastlines(color='gray',ax=ax)

fails with
mpl_toolkits\basemap\__init__.pyc in set_axes_limits 
   2531 if is_interactive():
   2532 figManager = _pylab_helpers.Gcf.get_active()
- 2533 figManager.canvas.draw()

AttributeError: 'NoneType' object has no attribute 'canvas'

Why isn't my figure being set as active??

Mathew








On Mon, Mar 29, 2010 at 11:12 AM, Yeates, Mathew C (388D) 
mathew.c.yea...@jpl.nasa.gov wrote:

  Hi

 Anyone have an example? I found some older examples which no longer work.



 TIA



 Mathew



 For grins …. The following does not work. I’ve tried many different
 variations …



 import matplotlib.pyplot as plt



 import gtk

 from mpl_toolkits.basemap import Basemap

 import matplotlib

 from matplotlib.figure import Figure

 fig=plt.Figure()

 ax=fig.add_subplot(111)

 m = Basemap(llcrnrlon=1, \

 llcrnrlat=40.6, \

 urcrnrlon=8.8, \

 urcrnrlat = 49.6, \

 projection = 'tmerc', \

 lon_0 = 4.9, \

 lat_0 = 45.1,ax=ax)



 from matplotlib.backends.backend_gtkagg import \

 FigureCanvasGTKAgg as FigureCanvas

 canvas = FigureCanvas(fig)

 m.drawcoastlines(color='gray')

 m.drawcountries(color='gray')

 m.fillcontinents(color='beige')

 builder = gtk.Builder()

 builder.add_from_file(fluxtool.glade)

 window1=builder.get_object(window1)

 window1.connect(destroy, lambda x: gtk.main_quit())





 vbox=builder.get_object(vbox1)

 vbox.pack_start(canvas)

 window1.show()

 gtk.main()




 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] simple example using Basemap in a gtk app??

2010-03-29 Thread Mathew Yeates
Solved. Sort of. If I run using python it works. It fails if I run using
ipython with --pylab.

On Mon, Mar 29, 2010 at 3:46 PM, Mathew Yeates mat.yea...@gmail.com wrote:

 I don't understand why the following fails.

 fig = Figure(figsize=(5,5), dpi=100)
 canvas = FigureCanvas(fig)
 ax = fig.add_subplot(111)
 m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax)
 m.drawcoastlines(color='gray',ax=ax)

 fails with
 mpl_toolkits\basemap\__init__.pyc in set_axes_limits 
2531 if is_interactive():
2532 figManager = _pylab_helpers.Gcf.get_active()
 - 2533 figManager.canvas.draw()

 AttributeError: 'NoneType' object has no attribute 'canvas'

 Why isn't my figure being set as active??

 Mathew








 On Mon, Mar 29, 2010 at 11:12 AM, Yeates, Mathew C (388D) 
 mathew.c.yea...@jpl.nasa.gov wrote:

  Hi

 Anyone have an example? I found some older examples which no longer work.



 TIA



 Mathew



 For grins …. The following does not work. I’ve tried many different
 variations …



 import matplotlib.pyplot as plt



 import gtk

 from mpl_toolkits.basemap import Basemap

 import matplotlib

 from matplotlib.figure import Figure

 fig=plt.Figure()

 ax=fig.add_subplot(111)

 m = Basemap(llcrnrlon=1, \

 llcrnrlat=40.6, \

 urcrnrlon=8.8, \

 urcrnrlat = 49.6, \

 projection = 'tmerc', \

 lon_0 = 4.9, \

 lat_0 = 45.1,ax=ax)



 from matplotlib.backends.backend_gtkagg import \

 FigureCanvasGTKAgg as FigureCanvas

 canvas = FigureCanvas(fig)

 m.drawcoastlines(color='gray')

 m.drawcountries(color='gray')

 m.fillcontinents(color='beige')

 builder = gtk.Builder()

 builder.add_from_file(fluxtool.glade)

 window1=builder.get_object(window1)

 window1.connect(destroy, lambda x: gtk.main_quit())





 vbox=builder.get_object(vbox1)

 vbox.pack_start(canvas)

 window1.show()

 gtk.main()




 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hoe to update a plot

2010-02-23 Thread Mathew Yeates
This looks correct. I went and look at the animation examples and they do
something similar.

Thx

-- Forwarded message --
From: Stephen George steve_...@optusnet.com.au
Date: Tue, Feb 23, 2010 at 6:28 PM
Subject: Re: [Matplotlib-users] hoe to update a plot
To: Matplotlib Users matplotlib-users@lists.sourceforge.net


C M wrote:
 On Tue, Feb 23, 2010 at 7:00 PM, Mathew Yeates mat.yea...@gmail.com
wrote:

 Hi
 I am using gtk and displaying a plot in a FigureCanvas. In response to an
 event, I want to update the plot with new data.

 e.g.
 self.fig = Figure(figsize=(5,5), dpi=100)
 self.ax = fig.add_subplot(111)
 ax.plot(data[0,0:,0],



 canvas = FigureCanvas(fig)
 canvas.set_size_request(500,500)

 def on_some_signal(self,widget):
 ?



I also may be wrong.

I thought ax.plot(..) would redraw everything (ticks, labels, etc)  to
do with the plot.

I've been using set_data as I thought it was meant to be quicker.
   self.cline[0].set_data(rX, myabs) # I have to make sure
I use correct line
::  ::
   self.canvas.draw()

To just change the data associated with a specific line on plot.

I stored the lines on my graph in a list called cline,  I captured the
line at time of creating of the plot
   r = self.axis.plot( rX, myabs ,self.linestyle, color='b')
   self.cline.append( r[0] )


- Steve




--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


On Tue, Feb 23, 2010 at 6:28 PM, Stephen George
steve_...@optusnet.com.auwrote:

 C M wrote:
  On Tue, Feb 23, 2010 at 7:00 PM, Mathew Yeates mat.yea...@gmail.com
 wrote:
 
  Hi
  I am using gtk and displaying a plot in a FigureCanvas. In response to
 an
  event, I want to update the plot with new data.
 
  e.g.
  self.fig = Figure(figsize=(5,5), dpi=100)
  self.ax = fig.add_subplot(111)
  ax.plot(data[0,0:,0],
 
 
 
  canvas = FigureCanvas(fig)
  canvas.set_size_request(500,500)
 
  def on_some_signal(self,widget):
  ?
 
 
 I also may be wrong.

 I thought ax.plot(..) would redraw everything (ticks, labels, etc)  to
 do with the plot.

 I've been using set_data as I thought it was meant to be quicker.
self.cline[0].set_data(rX, myabs) # I have to make sure
 I use correct line
 ::  ::
self.canvas.draw()

 To just change the data associated with a specific line on plot.

 I stored the lines on my graph in a list called cline,  I captured the
 line at time of creating of the plot
r = self.axis.plot( rX, myabs ,self.linestyle, color='b')
self.cline.append( r[0] )


 - Steve





 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] changing the size of a plot point

2008-10-27 Thread Mathew Yeates
is there a way, when plotting many points, to decrease the size of the
point. With the default size I end up with overlapping points so some are
not displayed.

Mathew
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] changing the size of a plot point

2008-10-27 Thread Mathew Yeates
Thank you!

On Mon, Oct 27, 2008 at 2:12 PM, Friedrich Hagedorn [EMAIL PROTECTED]wrote:

 On Mon, Oct 27, 2008 at 01:53:24PM -0700, Mathew Yeates wrote:
 is there a way, when plotting many points, to decrease the size of the
 point. With the default size I end up with overlapping points so some
 are
 not displayed.

 Do you want to change (decrease) the following values?

  plot(range(10), '.-', linewidth=3, markersize=15) # big values for testing

 I hope that helps.

 By,

  Friedrich

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] basemap with Python26

2008-10-23 Thread Mathew Yeates
Hi
I'm getting the traceback

 from mpl_toolkits.basemap import Basemap

/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py:44:
DeprecationWarning: the sha module is deprecated; use the hashlib module
instead
  import sha
Traceback (most recent call last):
  File stdin, line 1, in module
  File
/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/__init__.py,
line 39, in module
import _geoslib, pupynere, netcdftime
  File
/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/pupynere.py,
line 37, in module
from dap.client import open as open_remote
  File /home/myeates/lib/python2.6/site-packages/dap/client.py, line 4, in
module
from dap.util.http import openurl
  File /home/myeates/lib/python2.6/site-packages/dap/util/http.py, line 3,
in module
import httplib2
File /home/myeates/lib/python2.6/site-packages/httplib2/__init__.py, line
717, in module
class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'


anyone know what this is about?

Mathew
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] finding the intersection of 2 rectangles

2008-10-19 Thread Mathew Yeates
Is there an easy way to find the locations in rectangle1 that are covered by
rectangle2? I couldn't find this anywhere.

Mathew
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how to tell if a point is inside a polygon

2008-10-14 Thread Mathew Yeates
Is there a routine in matplotlib for telling whether  a point is inside a 
convex 4 sided polygon?

Mathew



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to tell if a point is inside a polygon

2008-10-14 Thread Mathew Yeates
Thanks! Thats exactly what I was looking for!

Mathew

Michael Droettboom wrote:
 If you can convert your polygon to a path, you can use the 
 contains_point method:

  from matplotlib import path
  p = path.Path([[0,0], [42, 3], [45, 23], [1, 32]])
  p.contains_point([5,5])
 1
  p.contains_point([72, 3])
 0

 Mike

 Mathew Yeates wrote:
 Is there a routine in matplotlib for telling whether  a point is 
 inside a convex 4 sided polygon?

 Mathew



 - 

 This SF.Net email is sponsored by the Moblin Your Move Developer's 
 challenge
 Build the coolest Linux based applications with Moblin SDK  win 
 great prizes
 Grand prize is a trip for two to an Open Source event anywhere in the 
 world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   




-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to tell if a point is inside a polygon

2008-10-14 Thread Mathew Yeates
Angus originally suggest matplotlib. The other proposed solutions are 
overkill, unless it turns out that performance is a problem

Thanks
Mathew

Pierre GM wrote:
 Mathew,
 Have you tried the solution that was suggested by Angus yesterday on the 
 numpy 
 mailing list ?

 http://projects.scipy.org/pipermail/scipy-user/2008-February/015418.html

   
 import numpy as np
 import matplotlib.nxutils as nxutils
 polygon=np.array([(0,0),(0,1),(1,1),(1,0)])
 points = np.array([(0.5,0.5),(0.4,1.5)])
 nxutils.points_inside_poly(points, polygon)
 
 array([1, 0], dtype=int32)

 Meaning that the first point is, the second is not.

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
 Build the coolest Linux based applications with Moblin SDK  win great prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] another noob question

2008-10-14 Thread Mathew Yeates
Any help appreciated

I am displaying a line on a map ala
--
m=Basemap(   )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
-
and then in an update routine I do


def update(newxpts,newypts):
outlines[0].set_data(newxpst,newypts)
---

This works fine but now I want to add additional lines. I tried


m=Basemap(   )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
slitlines=[]
for i in range(0,500):
slitlines.append(m.plot([],[],'b-'))


and


def update(newxpts,newypts,newslitx,newlity):
outlines[0].set_data(newxpst,newypts)
 for i in 
range(0,500):slitlines[i][0].set_data([startx[i],endx[i]],[starty[i],endy[i]])
-

but this doesn't work. Clearly I'm doing something wrong.
Whats the best way to do this?

Thanks
Mathew
 


   
   
   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] nevermind - Re: another noob question

2008-10-14 Thread Mathew Yeates
I had a bug in my code, when I fixed it I can now see the lines.
If there is a better way to do what I'm doing, and love to hear it.




Mathew Yeates wrote:
 Any help appreciated

 I am displaying a line on a map ala
 --
 m=Basemap(   )
 xpt,ypt= m([],[])
 outlines=m.plot(xpt,ypt,'r-')
 -
 and then in an update routine I do

 
 def update(newxpts,newypts):
 outlines[0].set_data(newxpst,newypts)
 ---

 This works fine but now I want to add additional lines. I tried

 
 m=Basemap(   )
 xpt,ypt= m([],[])
 outlines=m.plot(xpt,ypt,'r-')
 slitlines=[]
 for i in range(0,500):
 slitlines.append(m.plot([],[],'b-'))
 

 and

 
 def update(newxpts,newypts,newslitx,newlity):
 outlines[0].set_data(newxpst,newypts)
  for i in 
 range(0,500):slitlines[i][0].set_data([startx[i],endx[i]],[starty[i],endy[i]])
 -

 but this doesn't work. Clearly I'm doing something wrong.
 Whats the best way to do this?

 Thanks
 Mathew
  








 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
 Build the coolest Linux based applications with Moblin SDK  win great prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] displaying lat/lon in toolbar for Baemap

2008-10-13 Thread Mathew Yeates
Hi
Is there a way to display the latitude and longitude of the cursor when 
displaying a Basemap?

Mathew



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how do I get my axis

2008-10-13 Thread Mathew Yeates
Okay, I've gotten this far. I have a Figure and I think I can change the 
formatting of the values displayed in the toolbar by setting taking the 
X axis and setting the function
format_xdata
to something of my own (something that computes lat/lon). Similar idea 
for the Y axis.

So, given my figure, how do I get the X and Y axis? All I see is gca(). 
But how can I get both? Using fig.get_axes() I only got 1 axis.

Anybody know?

Mathew







-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how do I get my axis

2008-10-13 Thread Mathew Yeates
Thanks Angus. I tried this out ... it works once and only once!
BTW, The correct thing to do is
res=fig.gca()
res.fmt_xdata=foo() #instead of format_xdata
res.fmt_ydata=foo()

although, like I said, it only first for the first event. Somehow 
res.fmt_xdata is getting set back to None


Mathew


Angus McMorland wrote:
 Hi Mathew,

 2008/10/13 Mathew Yeates [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Okay, I've gotten this far. I have a Figure and I think I can
 change the
 formatting of the values displayed in the toolbar by setting
 taking the
 X axis and setting the function
 format_xdata
 to something of my own (something that computes lat/lon). Similar idea
 for the Y axis.

 So, given my figure, how do I get the X and Y axis? All I see is
 gca().
 But how can I get both? Using fig.get_axes() I only got 1 axis.


 I think this is a terminology issue: the axis objects returned by 
 gca() or in the list returned by get_axes() incorporate both the 
 'axes' in the sense of x and y axes. With the single result of gca() 
 you can get at both the x and y axes. For example:

 import matplotlib.pyplot as plt
 ax = plt.gca()
 ax.set_xlims(xmin=-1)
 ax.set_ylims(ymax=0)
 ax.format_xdata = ... # if this is how you use this bit - haven't 
 needed to change these myself
 ax.format_ydata = ... 

 I hope that helps,

 Angus.

 -- 
 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how do I get my axis

2008-10-13 Thread Mathew Yeates
Angus pointed out that I need to do
res.fmt_xdata=foo
Duh. I was evaluating foo.

But this still doesn't work!
The default formatting operation is still called.

Mathew



Mathew Yeates wrote:
 Thanks Angus. I tried this out ... it works once and only once!
 BTW, The correct thing to do is
 res=fig.gca()
 res.fmt_xdata=foo() #instead of format_xdata
 res.fmt_ydata=foo()

 although, like I said, it only first for the first event. Somehow 
 res.fmt_xdata is getting set back to None


 Mathew


 Angus McMorland wrote:
   
 Hi Mathew,

 2008/10/13 Mathew Yeates [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Okay, I've gotten this far. I have a Figure and I think I can
 change the
 formatting of the values displayed in the toolbar by setting
 taking the
 X axis and setting the function
 format_xdata
 to something of my own (something that computes lat/lon). Similar idea
 for the Y axis.

 So, given my figure, how do I get the X and Y axis? All I see is
 gca().
 But how can I get both? Using fig.get_axes() I only got 1 axis.


 I think this is a terminology issue: the axis objects returned by 
 gca() or in the list returned by get_axes() incorporate both the 
 'axes' in the sense of x and y axes. With the single result of gca() 
 you can get at both the x and y axes. For example:

 import matplotlib.pyplot as plt
 ax = plt.gca()
 ax.set_xlims(xmin=-1)
 ax.set_ylims(ymax=0)
 ax.format_xdata = ... # if this is how you use this bit - haven't 
 needed to change these myself
 ax.format_ydata = ... 

 I hope that helps,

 Angus.

 -- 
 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh
 



 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
 Build the coolest Linux based applications with Moblin SDK  win great prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how do I get my axis

2008-10-13 Thread Mathew Yeates
The reason it wasn't working is that my function foo didn't have the 
right signature.fmt_xdata takes 1 argument. I have no idea why I didn't 
see an exception displayed.

It's working now that I have
def foo(x) pass

Mathew

John Hunter wrote:
 On Mon, Oct 13, 2008 at 2:27 PM, Mathew Yeates [EMAIL PROTECTED] wrote:
   
 Angus pointed out that I need to do
 res.fmt_xdata=foo
 Duh. I was evaluating foo.

 But this still doesn't work!
 The default formatting operation is still called.
 

 This is the correct usage -- so if it is not working you need to post
 a complete example.  Perhaps you are not setting the correct Axes
 instance?

 JDH

   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] updating a basemap

2008-10-12 Thread Mathew Yeates
Hi

I see the example of updating a plot in 
examples/animation/gtk_timeout.py where the 2 lines

line.set_ydata(np.random.rand(10))
fig.canvas.draw_idle()



What is the equivalent when I want to update a Basemap with new 
latitudes and longitudes  and I have done
m=Basemap(..)
m.plot(longitude_list,latitude_list)

Thanks
Mathew



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] updating a basemap

2008-10-12 Thread Mathew Yeates
something isn't working
In my main routine I have
xpt,ypt= m(lons[0:500],lats[0:500])
outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of 
size 1. Huh?

then in my update routine I have
counter=0
def update():
global counter
xpt,ypt= 
m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500])
counter += 1
outlines[0].set_data(xpt,ypt)
canvas.draw_idle()
return True

but this produces strange results. After a few iterations the line 
disappears  completely. Is it wrong to use lists when I get xpt and ypt?

Mathew





Jeff Whitaker wrote:
 Mathew Yeates wrote:
 Hi

 I see the example of updating a plot in 
 examples/animation/gtk_timeout.py where the 2 lines
 
 line.set_ydata(np.random.rand(10))
 fig.canvas.draw_idle()
 


 What is the equivalent when I want to update a Basemap with new 
 latitudes and longitudes  and I have done
 m=Basemap(..)
 m.plot(longitude_list,latitude_list)

 Thanks
 Mathew
   

 Mathew:  The Basemap plot method returns a list of matplotlib Line2d 
 objects which you can use just as in the example.

 -Jeff




-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] updating a basemap

2008-10-12 Thread Mathew Yeates
never mind. Got it working. One annoying thing, though, when the line 
reaches the edge of the figure, a line is drawn horizontally to the 
other side. This doesn't happen when I display all of the points at once.

Mathew

Mathew Yeates wrote:
 something isn't working
 In my main routine I have
 xpt,ypt= m(lons[0:500],lats[0:500])
 outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of 
 size 1. Huh?

 then in my update routine I have
 counter=0
 def update():
 global counter
 xpt,ypt= 
 m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500])
 counter += 1
 outlines[0].set_data(xpt,ypt)
 canvas.draw_idle()
 return True

 but this produces strange results. After a few iterations the line 
 disappears  completely. Is it wrong to use lists when I get xpt and ypt?

 Mathew





 Jeff Whitaker wrote:
   
 Mathew Yeates wrote:
 
 Hi

 I see the example of updating a plot in 
 examples/animation/gtk_timeout.py where the 2 lines
 
 line.set_ydata(np.random.rand(10))
 fig.canvas.draw_idle()
 


 What is the equivalent when I want to update a Basemap with new 
 latitudes and longitudes  and I have done
 m=Basemap(..)
 m.plot(longitude_list,latitude_list)

 Thanks
 Mathew
   
   
 Mathew:  The Basemap plot method returns a list of matplotlib Line2d 
 objects which you can use just as in the example.

 -Jeff

 



 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
 Build the coolest Linux based applications with Moblin SDK  win great prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

   



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] coordinate transformations

2008-10-09 Thread Mathew Yeates
Hi
Are there any modules in matplotlib for coordinate transformations. In 
particular, I want to go from geodetic to WGS-84.

Thanks
Mathew


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] customizing Basemap

2008-10-06 Thread Mathew Yeates
Hi
How easy is it to customize the Basemap class? I seem to remember an 
example where something is added to the toolbar but I can't remember 
which example it was. What if I want to add a menu at the top of the window?

Mathew



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] customizing Basemap

2008-10-06 Thread Mathew Yeates
I found example I wish to build on. It's embedding_in_gtk2.py under 
mpl_examples/user_interfaces. I'll put a menu at the top. But how can I 
add a Basemap instead of a Figure?

Mathew


Jeff Whitaker wrote:
 Mathew Yeates wrote:
 Hi
 How easy is it to customize the Basemap class? I seem to remember an 
 example where something is added to the toolbar but I can't remember 
 which example it was. What if I want to add a menu at the top of the 
 window?

 Mathew

   

 Mathew:


 Basemap doesn't handle any GUI stuff - this is all done by matplotlib 
 proper.  So, you'll need to look at the matplotlib docs to see how to 
 customize the toolbar.

 -Jeff




-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users