refresh gui axes if wanted
7 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
Image Analyst
2012-4-21
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.
0 个评论
Paul
2012-4-22
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?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!