How to switch between Graphs in a GUI
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Thomas
am 8 Aug. 2018
Bearbeitet: Stephen23
am 8 Aug. 2018
Hallo,
I have a big calculation with more than 5 results each with his own figure/graph. I want to make a GUI with only one graph and a listbox where i can choose which of my results is loading into my graph and not a figure window for each result.
I wrote a simple Version of my Code for an short Impression of my Problem (.txt file) I didnt know how to override the complete previus plot.
2 Kommentare
Rik
am 8 Aug. 2018
You can either create all graphs in separate axis objects and set the visibility with your listbox callback, or recreate the selected graph with your listbox callback. The graphical calculation shouldn't take too long, even if calculating the underlying data takes ages.
Akzeptierte Antwort
Stephen23
am 8 Aug. 2018
Bearbeitet: Stephen23
am 8 Aug. 2018
One efficient solution is to plot all of the data in one/several axes, then just set the axes/line/patch/... Visible properties to select which ones can be seen. See my FEX submission brewermap_view's 2D/3D switch for an example of this:
This lets you plot your data continuously, but only show the user what they have selected, quite independently. As an alternative you could plot/create the line/patch/... objects, and then set their XData, YData, etc, when you want to change the plots.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!