The CurrentPoint error appears only in axes drawn in a uitab (not in a figure) and only after application of savefig/openfig of the fin´bure with the uitab. Ant it is only the y- and z coordinates that are corrupted.Please run the 'cperrordemo' code below for proofs of this.
I hope this bug will be corrected in coming updates.
enfors@kth.se
function cperrordemo
%Demonstrates a bug that corrupts CurrentPoint y- & z-coordinates
% of axes in a uitab, after the figure has been saved and re-opened
% with the commands savefig/openfig.
% If the axes is drawn directly in the figure, no such error appears
% Demonstrated in MATLAB R2022b / enfors@kth.se
f1=figure;
f1.Name='Axes i FIGURE BEFORE savefig';
plotaxis=axes(f1); % Create a plotaxis in the figure
plotaxis.Box='on';
hold on
plotaxis.Tag='plotaxis';
txt='Press mouse in the axes to see the CurrentPoint';
t=plotaxis.Title;
t.String=txt;
waitforbuttonpress
disp('CurrentPoint of plotaxies in FIGURE BEFORE savefig: ')
cp1=plotaxis.CurrentPoint % Get cursor position
savefig('f1') % Save and re-open the figure
%close(f1)
f2=openfig('f1');
f2.Name='Axes i FIGURE AFTER savefig/openfig';
a2=findobj(f2,'tag','plotaxis');
axes(a2)
%msgbox(txt)
waitforbuttonpress
disp('CurrentPoint of plotaxis drawn in FIGURE AFTER savefig: ')
cp2=a2.CurrentPoint % Get coordinate for the same cursor position
%Draw the plotaxies in a uitab
%close('f2')
f3=figure;
f3.Name='Axes i UITAB BEFORE savefig';
tabgrp = uitabgroup(f3);
tabgrp.Units='normalized';
tabgrp.Position=[0 0 1 1];
tabgrp.Tag='tabgroup';
tab = uitab(tabgrp); % The graph tab
tab.Title='Plotaxis in uitab';
tab.Units='normalized';
tab.Tag='tab';
%tabgrp.SelectedTab=tab;
plotaxis2=axes(tab); % Create a plotaxis in Graph tab
plotaxis2.Box='on';
hold on
plotaxis2.Tag='plotaxis2';
t2=plotaxis2.Title;
t2.String=txt;
%msgbox(txt)
waitforbuttonpress
disp('CurrentPoint of plotaxis drawn in TAB BEFORE savefig: ')
cp3=plotaxis2.CurrentPoint % Get cursor position
savefig('f3') % Save and re-open the figure
%close(f3)
f4=openfig('f3');
f4.Name='Axes in UITAB AFTER savefig/openfig';
a2=findobj(f4,'tag','plotaxis2');
axes(a2)
%msgbox(txt)
waitforbuttonpress
disp('CurrentPoint of plotaxis drawn in TAB AFTER openfig: ')
cp4=a2.CurrentPoint % Get coordinate for the same cursor position