How to use stackedplot on desired UIAxes at App Designer
27 views (last 30 days)
Show older comments
mustafa can Kurt
on 29 Sep 2021
Commented: mustafa can Kurt
on 29 Sep 2021
I want to use stackedplot at my app but I couldn't find a way to plot stackedplot at a specific UIAxes component.
stackedplot(app.A{7,1})
This is the syntax that I am currently using.
Thanks, Mustafa.
0 Comments
Accepted Answer
Dave B
on 29 Sep 2021
A stackedplot doesn't go in an axes, it's 'equivalent' to an axes in the sense that it goes in a figure or panel or tab. You could make a new stackedplot in your uifigure and set its position to the same as the uiaxes if your goal is to toggle between different types of plots, or use panels (or gridlayout) if your goal is to lay out your stackedplots.
3 Comments
Dave B
on 29 Sep 2021
You should be able to pass in the tab (app.Tab1) as the first argument to stackedplot. You'll still need to pass some data in as the stackedplot function requires it (you can use nan if you don't have any data yet), alternatively you could use the lower level matlab.graphics.chart.StackedLineChart('Parent',...) but that may be significantly more difficult.
Here's a demo with a programtically generated app:
u = uifigure;
tg = uitabgroup(u);
t1 = uitab(tg,'Title','Tab1');
t2 = uitab(tg,'Title','Tab2');
stackedplot(t1,rand(10,3))
stackedplot(t2,rand(10,4))
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!