Freezing a plot while updating data

17 views (last 30 days)
Adam
Adam on 5 Apr 2018
Answered: Walter Roberson on 16 Apr 2018
Does anyone know if there is an option that is essentially the opposite of drawnow that I can use to tell my plot not to draw until I next call drawnow? I have tried the limitrate flag for this, but that just slows it down which isn't good enough.
I am trying to change the CData of an image and then the colourmap and caxis range, but when I do this normally it briefly shows the new data with the old colourmap and range before flickering and updating fully. Inserting the limitrate drawnow option gets rid of the first problem, but I still get the flicker/jumping as it updates rather than a smooth transition from my original image with one colourmap and caxis range to a new plot with new colourmap and range.
  7 Comments
Adam
Adam on 9 Apr 2018
It turns out my slider + edit box class had a drawnow instruction in its edit box update function. I added this quite recently in response to some problem of the edit boxes not updating with the slider, but it seems to work fine now without it and my plot doesn't do a double update either which is good! Hopefully I won't find a scenario again where that drawnow was needed.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 16 Apr 2018
No, you cannot do exactly that.
The provided way to prevent intermediate updates before you are ready is to set the object (figure probably) visible property to 'off'. Resizing and the like are postponed until the object visibility is turned on again.
Making a figure visible again triggers a drawnow.
If you take long enough to calculate the updated information then something might trigger the figure to disappear (since you did turn it invisible.) My experience with hg1 was that there was a short time window during which if you turned the visibility back on then the figure would not flicker off and back on.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!