How to create two different graphs on top of each other, On a GUI, one visible and one not and then switch between them?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi All,
I created a GUI, using GUIDE, and in it I placed 2 different axes exactly on top of each other. My Idea is to create a different graph in each of them but to make only a selected one of them visible. To achieve this I added a group of two radio buttons to select the axes (with its graphs) that should be visible. For example - to switch between the now visible 'My_Axes_1' and the non visible 'My_Axes_2' I used:
My_Axes_1.Visible = 'Off';
My_Axes_2.Visible = 'On';
This seems to work. What is not working is that after creating the first graph on the first axes the other graph on the second axes is visible!. I tried many My_Axes_2.Visible = 'Off' during the creation of the graph but never succeeded to get a clear picture.
How can I plot the second graph and have this graph and its axes non visible until I use the right radio button?
Thanks,
Alon
댓글 수: 2
Stephen23
2016년 11월 27일
편집: Stephen23
2016년 11월 27일
What MATLAB version are you using?
If you want an example of code that does exactly what you want, have a look at my FEX submission brewermap, where the function brewermap_view includes a button that selects between 2D and 3D views of the colormaps. It works exactly as you describe (on pre-2014 MATLAB only).
답변 (1개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!