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

Contact us at files@mathworks.com