How do you keep the graphs in a constant location in Matlab App Designer?
4 views (last 30 days)
Show older comments
I have been trying to plot a couple of graphs on App Designer so that they can line up. However, whenever once the data is loaded the graphs shift slightly and the graphs do not stay where I orgnailly put them in the Design view. I have also tried to hard code the positions of the graphs, but it has not worked.
Here is the code I am using to fix the points of the graphs.
Length = 1335;
height = 150;
start = 15;
app.O2_Graph.Position = [start, 240, Length, height+100];
app.Salinity_Graph.Position = [start, 490, Length, height];
app.Temp_Graph.Position = [start, 630, Length, height];
2 Comments
dpb
on 5 Mar 2025
Probably the issue is that when the data are placed on the axes, varying amounts of spacing are needed for labels, etc., depending upon the precision.
Attaching sample data would be helpful...
Accepted Answer
Voss
on 5 Mar 2025
You can try specifying each (ui)axes InnerPosition, which excludes space for labels, tick labels, etc., rather than Position, adjusting the values appropriately, and/or setting each (ui)axes PositionConstraint to 'innerposition', which holds InnerPosition constant when the labels, etc., are updated.
3 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D 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!