From: Enrico on
I am using ginput to draw a polygon on a screen.
I don't get access to all the points that were picked until after the user hits enter so I cannot draw the points/lines on the screen til after the user hits enter.

This makes it difficult to draw things with lots of points.

Is there a way to mark the points as they are being draw, or draw lines as points are bing marked? Better yet, after the first point is selected, have a dynamic line from the point to the mouse. I know i can use rrbox to draw a rectangle. Is there something for any polygon shape?

The only way I could think of is to just get one point at a time with ginput and draw then one by one, but it seems tedious and not the best way performance-wise. ginput is already extremely slow for me.
From: Walter Roberson on
Enrico wrote:
> I am using ginput to draw a polygon on a screen.
> I don't get access to all the points that were picked until after the
> user hits enter so I cannot draw the points/lines on the screen til
> after the user hits enter.
>
> This makes it difficult to draw things with lots of points.
>
> Is there a way to mark the points as they are being draw, or draw lines
> as points are bing marked?

impoly() from the Image Processing Toolbox may be suitable for your needs.

You may also wish to fish through the Matlab File Exchange (FEX) on
matlabcentral.com as I believe I have encountered similar routines there.