Subplot position with App Designer
显示 更早的评论
I am using App Designer on MATLAB R2019a and would like to use a subplot to show different images side to side
I read a document here that explains how to set subplots with new version of MATLAB App Designer but the issue I face is regarding the positioning of such subplot.
I have an App with a panel called MyPanel where I want the subplot to appear. According the link above I do :
app.MyPanel.AutoResizeChildren = 'off';
CellAxes{1,1}=subplot(1,2,1,'Parent',app.MyPanel);
This create axes randomly set on MyPanel. Then when I want to change the position of my subplot though 'Position' variable, it changes only position of subplot(1,2,1). Next subplot will not be aligned with the previously set position for subplot(1,2,1).
What I am looking to is to set the first size and position of the subplot and then the next subplot(1,2,2) would align and be beside that previous plot.
In other words, when we call subplot, it creates axes by defaults in a certain position in the figure on which it will align coming subplots. I want to change that initial positiont value and let the subplot continue to do its magic on aligning the next subplots.
Hope it clear enough.
5 个评论
Scott Tomlins
2019-7-2
Have you found the solution?
Shubham Gupta
2019-7-2
编辑:Shubham Gupta
2019-7-2
Hey, why don't you shift both the plots instead of just one ? For e.g. If you shift the subplot-1 to the right by 'x' unit by setting it's "Position" property shift the subplot-2 by the same 'x' unit to the right this will not change the "relative" position of these subplots.
I am not sure if MATLAB automatically updates the relative position of the axes ?
Marc Youcef
2019-7-15
ZEINA AHDAB
2019-7-24
编辑:ZEINA AHDAB
2019-7-24
Hi, I am having a similar problem. The 2 subplots created by default are not alined, and one is on top of the other in my case. I didn't want to creat two different plots and use more if loops to control their 'on' 'off' visibilities, which whoud add more processes to the app. I guess it's the only solution I have for now though.
But I believe that so far the information provided by mathworks isn't enough for the user to manage the subplot command. At least it wasnt for me.
I hope it will be made more userfriendly soon.
Shubham Gupta
2019-7-25
@ZEINA AHDAB, can you please share your code with us, so we can understand why exactly your default subplots are not aligned because as far as I know, I haven't seen default subplots behaving like that?
Waiting to hear from you soon !
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!