Thread Subject: interactive plot functions

Subject: interactive plot functions

From: Alan B

Date: 20 Nov, 2008 22:46:02

Message: 1 of 1

I wrote a small function which displays two plots on a figure, and uses the windowbuttonmotionfcn to interactively modify the axis limits in the second plot, based on the mouse position in the first plot. The plots contain the same data, which right now is a set of two 240000-element vectors. The functionality is achieved by using a single function with an "action" input variable, and a big if-else block.

This program functions properly but it is a bit slow, the second plot will update about 2 times per second when I am moving the mouse around quickly. When I reduce the size of the vectors, it responds much more quickly. I can think of a few ways that I might be able to speed up the display, but I'm not sure if they'll work; originally I thought that changing the display by modifying axes limits would be the fastest way to do it, and that doesn't seem to be the case.

Before I try a bunch of different ideas to speed this up, I thought I'd ask here if anyone has had a similar problem, and if maybe there is a better way to structure my program.

Thanks for any help.

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
callback Alan B 20 Nov, 2008 17:50:21
plot Alan B 20 Nov, 2008 17:50:21
interactive Alan B 20 Nov, 2008 17:50:21
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com