- "AutoResizeChildren" is incapable of aligning axes using the "InnerPosition". "AutoResizeChildren" will only ever operate by setting the "OuterPosition" of the axes and setting the "OuterPosition" of the axes will toggle the "PositionConstraint" property to "outerposition".
- "AutoResizeChildren" works by setting a new "OuterPosition" on the axes whenever the "Figure" (or immediate container of the axes) is resized. Therefore, any time you resize the figure (or immediate container of the axes), the "PositionConstraint" of the axes will be toggled to "outerposition", regardless of its previous value.
- SIMPLEST APPROACH: Put both axes into a "Panel" (or another container) with the "AutoResizeChildren" property disabled. Then you can use a "PositionConstraint" of 'innerposition' and it should work as you would expect. You can also just disable "AutoResizeChildren" on the top-level figure.
- PREFERRED APPROACH: Put both axes into a 1x1 "tiledlayout". "tiledlayout" was designed with the intention of aligning the inner position of multiple axes with each other. The traditional use-case is to have a grid of Axes, but "tiledlayout" also works just as well to keep two axes that are in the same tile aligned with one another. You can put a "tiledlayout" directly in a "uifigure", or within a "Panel" or another container, then put the two axes within the "tiledlayout", and the "tiledlayout" will make sure they stay aligned with one another. Please refer to the following documentation for further information on the "tiledlayout" function: https://www.mathworks.com/help/matlab/ref/tiledlayout.html
- MOST CONTROL APPROACH: Disable "AutoResizeChildren" and instead use a "SizeChangedFcn" function on the container to run a function whenever the container size changes, and then use this function to do whatever layout of the axes you want.