Filter löschen
Filter löschen

refresh gui axes if wanted

8 Ansichten (letzte 30 Tage)
Szilvia
Szilvia am 21 Apr. 2012
Hi,
I have an axes on my GUI. can set some parameters on it and I have a "refresh" button and a checkbox for "refresh automatically". If the checkbox is checked, the plot should change whenever the user sets something (wether to show color bar, if the plot is faceted / flat shaded ect.)
I have found some suggessions for timer but this is surely not the correct solution for this. In other programming languages I would call the "refresh button" callback if the checkbox is checked but I am new to matlab and I can not find how to achive the same result. What expressions should I look for? Is there some way of linking object events?
thanks
Szilvia

Antworten (2)

Image Analyst
Image Analyst am 21 Apr. 2012
If the user changed something so that your plotted data changed, (like the x or y values) then you need to call the function (plot, bar, pie, plotyy, whatever) again to update it with the new data.
If the appearance of the plot (like the title, xlabel, size, whatever) was supposed to change, then it should change right away.
The only time when replotting or changing appearance won't work right away is if you're in some intensive loop that's going so fast and furious that the "behind the scenes" message to update/refresh your plot (or image or axes) never gets acted upon. In that situation you can call " drawnow" inside your loop to force it to update on each loop iteration.

Paul
Paul am 22 Apr. 2012
A long way to do it would be writing an if statement for each button that could be pressed. This is a bit of a hassle though. And is not a very good way to do it. What exactly are you doing?

Kategorien

Mehr zu Axes Appearance finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by