Thread Subject: Dragging a selection square on a plot?

Subject: Dragging a selection square on a plot?

From: Alexander

Date: 15 Nov, 2009 14:20:03

Message: 1 of 2

Hello,

suppose you have a figure with some plot. I would like the user to be able to drag a little selection square in some area of the plot. After the selection has been performed, I would like to obtain the x1,x2,y1,y2 coordinates of the square and e.g. perform an new computation of the plot with in the new coordinates. This is not supposed to be a simple zoom (like the magnification glass from the toolbar) as I want to recompute the plot to obtain a higher precision.

The plot I am talking about may possibly be within a solitary figure like created by a figure(1) command, or possibly an axis within a GUI figure.

I am quite sure that there must either be a very simple way to do this, or someone has written the code already. So I'd be greatful for some help.

Regards,

Alexander

Subject: Dragging a selection square on a plot?

From: Jan Simon

Date: 15 Nov, 2009 14:58:01

Message: 2 of 2

Dear Alexander!

> suppose you have a figure with some plot. I would like the user to be able to drag a little selection square in some area of the plot. After the selection has been performed, I would like to obtain the x1,x2,y1,y2 coordinates of the square and e.g. perform an new computation of the plot with in the new coordinates. This is not supposed to be a simple zoom (like the magnification glass from the toolbar) as I want to recompute the plot to obtain a higher precision.
>
> The plot I am talking about may possibly be within a solitary figure like created by a figure(1) command, or possibly an axis within a GUI figure.

Have you tried RBBOX or DRAGRECT?

Good luck, Jan

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com