28 Jul 2010 02:31

## contour's polygons

```Hi,

I'm 6 months into learning python and haven't been able to find a way
to do this, so I hope you don't mind a basic question.

I'd like to use the polygons contour makes but I can't figure out how
information would be excellent.

Thanks,
Phil

--

--
Phil Rosenfield
http://www.astro.washington.edu/philrose

------------------------------------------------------------------------------
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://clk.atdmt.com/CRS/go/247765532/direct/01/
```
28 Jul 2010 20:31

### Re: contour's polygons

```On 07/27/2010 02:31 PM, Phil Rosenfield wrote:
> Hi,
>
> I'm 6 months into learning python and haven't been able to find a way
> to do this, so I hope you don't mind a basic question.
>
> I'd like to use the polygons contour makes but I can't figure out how
> to get them from ContourSet. Any examples or links to helpful
> information would be excellent.

They are buried.  Each contour set has a list of collections, and
each of those collections has a set of paths, and each of those paths
has a vertices attribute for its corresponding polygon.  In the
following we will pick out the first path of the first collection.

cs = contour(rand(6,6))
c = cs.collections[0]
p = c.get_paths()[0]
v = p.vertices

lev = cs.levels[0]

The levels attribute is a list of levels corresponding to the list of
collections: one collection per level.

Eric

> Thanks,
> Phil
>
```

28 Jul 2010 17:05

### Re: contour's polygons

On 28 July 2010 01:31, Phil Rosenfield wrote:
I'd like to use the polygons contour makes but I can't figure out how
information would be excellent.

Attached is an example of how to extract the polygons from a ContourSet.
Attachment (contour_polygons.py): text/x-python, 1447 bytes
```------------------------------------------------------------------------------
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://p.sf.net/sfu/dev2dev-palm```
```_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
```

Gmane