How to change displayed plot in a GUI with pop-up menu.

5 views (last 30 days)
I am developing a GUI using guide for a function I have written which results in (a minimum) of 5 plot figures. Is there a way that i can use a popup menu (in which i already have the 5 plots as selectable items) to choose which plot the user sees? Presently the target axes (axes1) is populated with the last plot the function produces.

Accepted Answer

Joseph Cheng
Joseph Cheng on 10 Jun 2016
Edited: Joseph Cheng on 10 Jun 2016
Yes.... look at the guide quick start templates. type in guide into the workspace and it'll open the quick start window. Select the GUI with Axes and Menu template and there is a example of plots, axis and button implementation. you can adjust the code and instead use the popup callback to do your plotting when that value changes. the implementation is similar to how the button update will do except you're checking changed value within the popup callback
  1 Comment
Chris O'Shea
Chris O'Shea on 10 Jun 2016
Yes this worked, thank you. I was unaware of switch/case.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!