Skip to content

Commit f7e3df7

Browse files
author
埃博拉酱
committed
Graphics.GetYAxis:修复问题
1 parent 7c1460c commit f7e3df7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

+MATLAB/+Graphics/GetYAxis.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
%[text] YAxis(1,1)matlab.graphics.Graphics,输入对象所属的Y轴
1111
function YAxis=GetYAxis(GObject)
1212
Ax=GObject.Parent;
13-
yyaxis(Ax,'right');
14-
YAxis=Ax.YAxis(1+any(Ax.Children==GObject));
13+
if isscalar(Ax.YAxis)
14+
YAxis=Ax.YAxis;
15+
else
16+
yyaxis(Ax,'right');
17+
YAxis=Ax.YAxis(1+any(Ax.Children==GObject));
18+
end
1519
end
1620

1721
%[appendix]{"version":"1.0"}

0 commit comments

Comments
 (0)