MATLAB: Can I format a GUIDE app’s axes given positional vectors defined in an App Designer app

MATLAB

I have built an app in App Designer, but it is missing some necessary functionality. I would like to replicate the spacing on my GUIDE app using the positional vectors defined in the App Designer Code. Can I use the "Position" vectors from "App Designer" as the "OuterPosition" vectors in GUIDE?

Best Answer

Yes, you may set the positions of your axes in GUIDE using the same position vectors that were assigned in App Designer. However, there are a few key points to note:
  1. The default units for App Designer's uiaxes are in 'pixels', whereas GUIDE's axes use normalized units by default. You may change this by setting the 'Units' property of each axes in the GUIDE application to 'pixels'. 
  2. The Position for the figure window in App Designer is equivalent to the InnerPosition in GUIDE. This means that if you are setting the overall figure size in GUIDE to match your App Designer application, you will need to set the InnerPosition of the GUIDE app to be the Position of the App Designer application.
These differences are caused in part by the different ways in which the App Designer and GUIDE handle axes: App Designer uses a 'uiaxes' object to display axes, whereas GUIDE uses an 'axes' object. For more information, please refer to the following documentation links: