|
From: Fabrice S. <si...@lm...> - 2012-06-07 14:50:23
|
Le jeudi 07 juin 2012 à 14:07 +0100, David Craig a écrit :
> Hi,
> I trying to define an area in a pcolor plot (several plots) using the
> ginput(). However since it is an irregular shape and will be different
> in each plot so I cant define how many points there will be before hand,
> I've tried the following but it requires a double click at each point,
> which I would like to avoid as it duplicates points
>
> |x = randn(10,10)
> imshow(x)
>
> button = False
> points = []
> while button == False:
> points.append(ginput(1))
> button = waitforbuttonpress()
> |
>
> Anyone know a better way to go about this??
> thanks
> Dave
ginput has a way to do it. From docs:
If n is zero or negative, accumulate clicks until a middle click
(or potentially both mouse buttons at once) terminates the
input.
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.ginput
Pressing [enter] also terminates the points acquisition.
--
Fabrice Silva <si...@lm...>
LMA UPR CNRS 7051
|