[Matplotlib-users] Basemap to KML polygon

2008-07-22 Thread Lionel Roubeyrie
Looks like I've done a mistake with my last post, sorry Eli...
I know how to save datas to a shapefile with the OGR library but only 
for points datas.
I'll appreciate if somebody can point me how to save a filled contour 
map basemap into a polygon shapefile, can't find any example with google.
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 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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap to KML polygon

2008-07-22 Thread Jeff Whitaker
Lionel Roubeyrie wrote:
> Looks like I've done a mistake with my last post, sorry Eli...
> I know how to save datas to a shapefile with the OGR library but only 
> for points datas.
> I'll appreciate if somebody can point me how to save a filled contour 
> map basemap into a polygon shapefile, can't find any example with google.
> Thanks
>
>   
Lionel:  I've never done that, and don't know anyone who has.  Would be 
a valuable contribution though.

-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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] default mathtext font

2008-07-22 Thread Michael Droettboom
As an alternative, you could just use Unicode to insert the Greek 
characters:

r"α-Fe (Someone 2003)"

The default font used by matplotlib, Vera Sans, includes a full set of 
Greek characters. This, of course, requires an editor that supports 
Unicode and a coding directive at the top of your source files, eg.:

# -*- coding: utf-8 -*-

Cheers,
Mike

Eli Brosh wrote:
> Here is the use case I have in mind:
> Plotting properties of various phases of iron, I need a legend with 
> greek letters and normal text:
> \alpha-Fe, Someone (2003)
>
> Now, I need the names e.g. someone to be upright.
> Also, the relbar between \alpha and Fe is shorter with normal text 
> fonts than with italics.
>
> I can solve the problem by using r'\rm{\alpha-Fe, Someone (2003)}' but 
> it would be easier if I could just change the defaults.
>
> Eli
>
>
> On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom <[EMAIL PROTECTED] 
> > wrote:
>
> Unfortunately there isn't. This is *theoretically* possible with
> the STIX fonts, but that hasn't been implemented. However, with
> the Computer Modern fonts, many of the glyphs simply aren't
> present (upright Greek, for example) to make this happen.
>
> That said, I'm not sure this is necessarily a good idea. Math has
> a set of commonly accepted conventions about when to use italic
> vs. upright that may only confuse the reader when not followed.
> Can you provide a use case?
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
> Hello
> I there a way to change the default mathtext font from cal to rm ?
> I would like to use the rm (serif) font without stating
> rm{...} or mathrm{...}.
> Is it possible to do using the matplotlibrc ?
> can you give me an example of how this is done ?
>
> Thanks
> Eli
> 
> 
>
> 
> -
> 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=100&url=/
> 
> 
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] *Non-interactive* image generation?

2008-07-22 Thread "Jonathan Hayward http://JonathansCorner.com"
I would like to use pylab in a CGI script that would generate a pie
chart/bar graph/..., save it to a file, and then be able to output the image
from the file.

Everything that I've tried works if I run the script from my shell, but when
it runs on my test box (or, for that matter, a sudo without an X display
being set up), it gripes about not being able to open an X display.

Is there a way to either:

1: Tell pylab to run without a display,
2: Configure a dummy display, or
3: Attach the web environment to a real display?

I'm not having it display windows or asking for interesting X
functionality--just generate a pie chart and save it as a file.

-- 
-- Jonathan Hayward, [EMAIL PROTECTED]

** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
-
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=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] *Non-interactive* image generation?

2008-07-22 Thread Michael Droettboom
You probably want to look at this FAQ:

http://matplotlib.sourceforge.net/faq.html#APPSERVER

Or the slightly more updated and elaborate answer in the new 
(in-progress) docs:

http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-use-matplotlib-in-a-web-application-server

Cheers,
Mike

"Jonathan Hayward http://JonathansCorner.com"; wrote:
> I would like to use pylab in a CGI script that would generate a pie 
> chart/bar graph/..., save it to a file, and then be able to output the 
> image from the file.
>
> Everything that I've tried works if I run the script from my shell, 
> but when it runs on my test box (or, for that matter, a sudo without 
> an X display being set up), it gripes about not being able to open an 
> X display.
>
> Is there a way to either:
>
> 1: Tell pylab to run without a display,
> 2: Configure a dummy display, or
> 3: Attach the web environment to a real display?
>
> I'm not having it display windows or asking for interesting X 
> functionality--just generate a pie chart and save it as a file.
>
> -- 
> -- Jonathan Hayward, [EMAIL PROTECTED] 
> 
>
> ** To see an award-winning website with stories, essays, artwork,
> ** games, and a four-dimensional maze, why not visit my home page?
> ** All of this is waiting for you at http://JonathansCorner.com
>
> ++ Would you like to curl up with one of my hardcover books?
> ++ You can now get my books from http://CJSHayward.com
> 
>
> -
> 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=100&url=/
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] default mathtext font

2008-07-22 Thread Eli Brosh
Thanks,
This seems to be a solution.
I have an editor that supports unicode.
But, can you please explain better how do I make the coding directive at the
top of my source files ?
Where do I write the command:
# -*- coding: utf-8 -*-

Is it inside the python script ?


Sorry for the ignorance.
Eli

On Tue, Jul 22, 2008 at 10:14 AM, Michael Droettboom <[EMAIL PROTECTED]>
wrote:

> As an alternative, you could just use Unicode to insert the Greek
> characters:
>
> r"α-Fe (Someone 2003)"
>
> The default font used by matplotlib, Vera Sans, includes a full set of
> Greek characters. This, of course, requires an editor that supports Unicode
> and a coding directive at the top of your source files, eg.:
>
> # -*- coding: utf-8 -*-
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
>> Here is the use case I have in mind:
>> Plotting properties of various phases of iron, I need a legend with greek
>> letters and normal text:
>> \alpha-Fe, Someone (2003)
>>
>> Now, I need the names e.g. someone to be upright.
>> Also, the relbar between \alpha and Fe is shorter with normal text fonts
>> than with italics.
>>
>> I can solve the problem by using r'\rm{\alpha-Fe, Someone (2003)}' but it
>> would be easier if I could just change the defaults.
>>
>> Eli
>>
>>
>> On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom <[EMAIL 
>> PROTECTED]> [EMAIL PROTECTED]>> wrote:
>>
>>Unfortunately there isn't. This is *theoretically* possible with
>>the STIX fonts, but that hasn't been implemented. However, with
>>the Computer Modern fonts, many of the glyphs simply aren't
>>present (upright Greek, for example) to make this happen.
>>
>>That said, I'm not sure this is necessarily a good idea. Math has
>>a set of commonly accepted conventions about when to use italic
>>vs. upright that may only confuse the reader when not followed.
>>Can you provide a use case?
>>
>>Cheers,
>>Mike
>>
>>Eli Brosh wrote:
>>
>>Hello
>>I there a way to change the default mathtext font from cal to rm ?
>>I would like to use the rm (serif) font without stating
>>rm{...} or mathrm{...}.
>>Is it possible to do using the matplotlibrc ?
>>can you give me an example of how this is done ?
>>
>>Thanks
>>Eli
>>
>>  
>>
>>
>>  -
>>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=100&url=/
>>
>>
>>  
>>
>>___
>>Matplotlib-users mailing list
>>Matplotlib-users@lists.sourceforge.net
>>
>>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-
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=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] default mathtext font

2008-07-22 Thread Michael Droettboom
Yes, you would put it at the top of your .py file.

In order to use Unicode in Python source code, you have to tell the 
Python interpreter what encoding the file is in.  That's done with a 
little "magic" comment at the top of the file.  The popular Unixy 
editors (emacs, vim etc.) also understand this comment and will save the 
file correctly.  Possibly other editors do as well.

For more gory details that you probably need, see this:

http://www.amk.ca/python/howto/unicode

particularly the section "Unicode Literals in Python Source Code".

Cheers,
Mike

Eli Brosh wrote:
> Thanks,
> This seems to be a solution.
> I have an editor that supports unicode.
> But, can you please explain better how do I make the coding directive 
> at the top of my source files ?
> Where do I write the command:
> # -*- coding: utf-8 -*-
>
> Is it inside the python script ?
>
>
> Sorry for the ignorance.
> Eli
>
> On Tue, Jul 22, 2008 at 10:14 AM, Michael Droettboom <[EMAIL PROTECTED] 
> > wrote:
>
> As an alternative, you could just use Unicode to insert the Greek
> characters:
>
> r"α-Fe (Someone 2003)"
>
> The default font used by matplotlib, Vera Sans, includes a full
> set of Greek characters. This, of course, requires an editor that
> supports Unicode and a coding directive at the top of your source
> files, eg.:
>
> # -*- coding: utf-8 -*-
>
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
> Here is the use case I have in mind:
> Plotting properties of various phases of iron, I need a legend
> with greek letters and normal text:
> \alpha-Fe, Someone (2003)
>
> Now, I need the names e.g. someone to be upright.
> Also, the relbar between \alpha and Fe is shorter with normal
> text fonts than with italics.
>
> I can solve the problem by using r'\rm{\alpha-Fe, Someone
> (2003)}' but it would be easier if I could just change the
> defaults.
>
> Eli
>
>
> On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom
> <[EMAIL PROTECTED] 
> >> wrote:
>
>Unfortunately there isn't. This is *theoretically* possible
> with
>the STIX fonts, but that hasn't been implemented. However, with
>the Computer Modern fonts, many of the glyphs simply aren't
>present (upright Greek, for example) to make this happen.
>
>That said, I'm not sure this is necessarily a good idea.
> Math has
>a set of commonly accepted conventions about when to use italic
>vs. upright that may only confuse the reader when not followed.
>Can you provide a use case?
>
>Cheers,
>Mike
>
>Eli Brosh wrote:
>
>Hello
>I there a way to change the default mathtext font from
> cal to rm ?
>I would like to use the rm (serif) font without stating
>rm{...} or mathrm{...}.
>Is it possible to do using the matplotlibrc ?
>can you give me an example of how this is done ?
>
>Thanks
>Eli
>  
>  
> 
>
>  
>  
> -
>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=100&url=/
> 
>  
>   >
>  
>  
> 
>
>___
>Matplotlib-users mailing list
>Matplotlib-users@lists.sourceforge.net
> 
> >
>
>  
>  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope

[Matplotlib-users] Scaling--I couldn't find it, but should this be in FAQ list?

2008-07-22 Thread "Jonathan Hayward http://JonathansCorner.com"
I'm tinkering with a modified version of
http://matplotlib.sourceforge.net/screenshots/barchart_demo.py :

# a bar plot with errorbars
# a bar plot with errorbars
from pylab import *

N = 5
menMeans = (20, 35, 30, 35, 27)
menStd =   ( 2,  3,  4,  1,  2)

ind = arange(N)  # the x locations for the groups

width = 0.35   # the width of the bars
p1 = bar(ind, menMeans, width, color='r', yerr=menStd)

womenMeans = (25, 32, 34, 20, 25)
womenStd =   ( 3,  5,  2,  3,  3)
p2 = bar(ind+width, womenMeans, width, color='y', yerr=womenStd)


ylabel('Scores')
title('Scores by group and gender')
xticks(ind+width, ('G1', 'G2', 'G3', 'G4', 'G5') )
xlim(-width,len(ind))
yticks(arange(0,41,10))


legend( (p1[0], p2[0]), ('Men', 'Women'), shadow=True)
show()

I would like to shrink the graph height to a third or a fourth of its
present value, and possibly cut the padding. How can I control that?

TIA,

-- 
-- Jonathan Hayward, [EMAIL PROTECTED]

** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
-
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=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Scaling--I couldn't find it, but should this be in FAQ list?

2008-07-22 Thread John Hunter
On Tue, Jul 22, 2008 at 3:51 PM, Jonathan Hayward http://JonathansCorner.com
> I would like to shrink the graph height to a third or a fourth of its
> present value, and possibly cut the padding. How can I control that?

You can create an axes for plotting into with whatever dimensions you
want, by manually spcifying

  axes([left, bottom, width, height])

where each are in relative 0..1 coordinates.  Eg, for a smaller height
with more padding all around

  axes([0.2, 0.2, 0.6, 0.4])

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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Border appearance

2008-07-22 Thread "Jonathan Hayward http://JonathansCorner.com"
On the two routines I'm modifying from examples, boundaries and borders are
generally a hefty black.

How can I control color and/or thickness and/or turn off items like
boundaries that are drawn in black?

-- 
-- Jonathan Hayward, [EMAIL PROTECTED]

** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
-
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=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Scaling--I couldn't find it, but should this be in FAQ list?

2008-07-22 Thread John Hunter
On Tue, Jul 22, 2008 at 4:06 PM, Jonathan Hayward
http://JonathansCorner.com <[EMAIL PROTECTED]> wrote:
> Thank you; I've shrunk the graphic part.

Please respond to the mailing list ("reply to all")


> When I save it as an image, it's painting an 800x600 image, so I've shrunk
> the portion of the 800x600 image I'm using. Is there a way to crop or do
> something comparable?

Not sure I understand the question.  You can control the figure size
in pixels by setting the figure size in inches and the dpi -- the
pixel size is the prodict of the two

  fig = figure((8,6), dpi=100)  # 800x600

you can control the *relative* proportion of the axes by using the
axes command as before

  ax = axes([left, bottom, width, height])

with these two, you should be able to get whatever size and
proportions you want.

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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Border appearance

2008-07-22 Thread John Hunter
On Tue, Jul 22, 2008 at 4:28 PM, Jonathan Hayward
http://JonathansCorner.com <[EMAIL PROTECTED]> wrote:
> On the two routines I'm modifying from examples, boundaries and borders are
> generally a hefty black.
>
> How can I control color and/or thickness and/or turn off items like
> boundaries that are drawn in black?

There are two borders in question, the figure border and the axes
border.  Both are rectangle instances.  You can control the figure
border with the figurePatch instance

fig.figurePatch.set_edgecolor('white')
fig.figurePatch.set_linewidth(0.5)

and similarly for the axes axesFrame instance

ax = axes([left, bottom, width, height])
ax.axesFrame.set_edgecolor('red')
ax.axesFrame.set_linewidth(0.5)

You can make the frame invisible in a few different ways:

 * set the edgecolor to be the same as the face color
 * set the linewidth to 0
 * set the visible property to False (ax.axesFrame.set_visible(False))

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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap to KML polygon

2008-07-22 Thread Tim Michelsen
> Looks like I've done a mistake with my last post, sorry Eli...
> I know how to save datas to a shapefile with the OGR library but only 
> for points datas.


> I'll appreciate if somebody can point me how to save a filled contour 
> map basemap into a polygon shapefile, can't find any example with google.
What do you really want to save here?
A basemap with a contour surface overlayed can be viewed as a assembly 
of various layers. So this is like the result of the gis operations when 
you launch the map composer to finish your map.

If you want to create a raster file from the contour part plotted over a 
basemap I think the python bindings of gdal will get you started.
http://pypi.python.org/pypi/GDAL/
I succeded into writing a tiff file from a gdal array.

I don't know how to write a vector file from python with ogr or shapely. 
  But these questions are better to be asked on the gdal list.:

So about interpolating to a contour look at shapely. Writing should be 
accomplished with ogr.

That said, I only have testing "experience" with writing geodata with 
python.

The overkill may be to invoke the respective GRASS command by a script.

I would appreciate if you would tell us what you use by the end.

Kind regards,
Timmie


When it comes to python and GIS the first stop seems to be:

* http://gispython.org/
* http://lists.gispython.org/mailman/listinfo/community

Some more links:
* http://de.giswiki.net/wiki/Kategorie:Python
* http://de.giswiki.net/wiki/WorldMill
* http://zcologia.com/news/750/keytree/
* http://sgillies.net/


-
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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users