how to create a collections.LineCollection instance?

Dear all,

I want to make an example of collections.LineCollection instance. So I have

In [150]: line
Out[150]: [(0, 0), (0, 1), (1, 1), (1, 0)]

but I use whatever the following I meet with an Assertion Error:

mat.collections.LineCollection(np.array(line))
mat.collections.LineCollection(tuple(line))
mat.collections.LineCollection(line)

could anyone explain me a little bit?

thanks et cheers,

Chao

···


Chao YUE
Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex

Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16


I should use mat.collections.LineCollection([line])

cheers,

Chao

2012/4/29 Chao YUE <chaoyuejoy@…878…287…>

···

Chao YUE
Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex

Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16


Dear all,

I want to make an example of collections.LineCollection instance. So I have

In [150]: line
Out[150]: [(0, 0), (0, 1), (1, 1), (1, 0)]

but I use whatever the following I meet with an Assertion Error:

mat.collections.LineCollection(np.array(line))
mat.collections.LineCollection(tuple(line))
mat.collections.LineCollection(line)

could anyone explain me a little bit?

thanks et cheers,

Chao


Chao YUE
Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex

Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16