📄 subplot.cpp
字号:
//
// error('Function called with too many output arguments')
//
error(_mxarray56_);
//
// else
//
} else {
//
// set(gcf,'NextPlot','replace'); return,
//
ans.EqAns(
Nset(0, mwVarargin(mwVe(gcf()), _mxarray58_, _mxarray51_)));
goto return_;
//
// end
//
}
//
// end
//
}
//
// sibs = datachildren(gcf);
//
sibs = datachildren(mwVe(gcf()));
//
// got_one = 0;
//
got_one = _mxarray4_;
//
// for i = 1:length(sibs)
//
{
int v_(mclForIntStart(1));
int e_(mclForIntEnd(mwArray(mclLengthInt(mwVv(sibs, "sibs")))));
if (v_ > e_) {
i = _mxarray60_;
} else {
//
// % Be aware that handles in this list might be destroyed before
// % we get to them, because of other objects' DeleteFcn callbacks...
// if(ishandle(sibs(i)) & strcmp(get(sibs(i),'Type'),'axes'))
// units = get(sibs(i),'Units');
// set(sibs(i),'Units','normalized')
// sibpos = get(sibs(i),'Position');
// set(sibs(i),'Units',units);
// intersect = 1;
// if( (position(1) >= sibpos(1) + sibpos(3)-tol) | ...
// (sibpos(1) >= position(1) + position(3)-tol) | ...
// (position(2) >= sibpos(2) + sibpos(4)-tol) | ...
// (sibpos(2) >= position(2) + position(4)-tol))
// intersect = 0;
// end
// if intersect
// if got_one | any(abs(sibpos - position) > tol)
// delete(sibs(i));
// else
// got_one = 1;
// set(gcf,'CurrentAxes',sibs(i));
// if strcmp(nextstate,'new')
// create_axis = 1;
// else
// create_axis = 0;
// end
// end
// end
// end
// end
//
for (; ; ) {
mwArray a_(mwVe(
ishandle(
mwVe(
mclIntArrayRef(
mwVsv(sibs, "sibs"), v_)))));
if (tobool(a_)
&& tobool(
a_
& mwVe(
strcmp(
mwVe(
Nget(
1,
mwVarargin(
mwVe(
mclIntArrayRef(
mwVsv(sibs, "sibs"), v_)),
_mxarray61_))),
_mxarray11_)))) {
units
= Nget(
1,
mwVarargin(
mwVe(mclIntArrayRef(mwVsv(sibs, "sibs"), v_)),
_mxarray63_));
ans.EqPrintAns(
Nset(
0,
mwVarargin(
mwVe(mclIntArrayRef(mwVsv(sibs, "sibs"), v_)),
_mxarray63_,
_mxarray39_)));
sibpos
= Nget(
1,
mwVarargin(
mwVe(mclIntArrayRef(mwVsv(sibs, "sibs"), v_)),
_mxarray65_));
ans.EqAns(
Nset(
0,
mwVarargin(
mwVe(mclIntArrayRef(mwVsv(sibs, "sibs"), v_)),
_mxarray63_,
mwVv(units, "units"))));
intersect = _mxarray5_;
{
mwArray a_0(mwVe(
mclIntArrayRef(
mwVsv(position, "position"), 1))
>= mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 1))
+ mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 3))
- mwVv(tol, "tol"));
if (tobool(a_0)) {
a_0 = 1;
} else {
a_0
= a_0
| mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 1))
>= mwVe(
mclIntArrayRef(
mwVsv(position, "position"), 1))
+ mwVe(
mclIntArrayRef(
mwVsv(position, "position"),
3))
- mwVv(tol, "tol");
}
if (tobool(a_0)) {
a_0 = 1;
} else {
a_0
= a_0
| mwVe(
mclIntArrayRef(
mwVsv(position, "position"), 2))
>= mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 2))
+ mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 4))
- mwVv(tol, "tol");
}
if (tobool(a_0)
|| tobool(
a_0
| mwVe(
mclIntArrayRef(
mwVsv(sibpos, "sibpos"), 2))
>= mwVe(
mclIntArrayRef(
mwVsv(position, "position"),
2))
+ mwVe(
mclIntArrayRef(
mwVsv(position, "position"),
4))
- mwVv(tol, "tol"))) {
intersect = _mxarray4_;
} else {
}
}
if (tobool(mwVv(intersect, "intersect"))) {
mwArray a_1(mwVv(got_one, "got_one"));
if (tobool(a_1)
|| tobool(
a_1
| mwVe(
any(
mwVe(
abs(
mwVv(sibpos, "sibpos")
- mwVv(position, "position")))
> mwVv(tol, "tol"))))) {
delete_func(
mwVarargin(
mwVe(
mclIntArrayRef(
mwVsv(sibs, "sibs"), v_))));
} else {
got_one = _mxarray5_;
ans.EqAns(
Nset(
0,
mwVarargin(
mwVe(gcf()),
_mxarray30_,
mwVe(
mclIntArrayRef(
mwVsv(sibs, "sibs"), v_)))));
if (tobool(
mwVe(
strcmp(
mwVv(nextstate, "nextstate"),
_mxarray67_)))) {
create_axis = _mxarray5_;
} else {
create_axis = _mxarray4_;
}
}
}
} else {
}
if (v_ == e_) {
break;
}
++v_;
}
i = v_;
}
}
//
// set(gcf,'NextPlot',nextstate);
//
ans.EqAns(
Nset(
0,
mwVarargin(
mwVe(gcf()), _mxarray58_, mwVv(nextstate, "nextstate"))));
//
// end
//
}
//
//
// % create the axis:
// if create_axis
//
if (tobool(mwVv(create_axis, "create_axis"))) {
//
// if strcmp(nextstate,'new'), figure, end
//
if (tobool(mwVe(strcmp(mwVv(nextstate, "nextstate"), _mxarray67_)))) {
ans.EqPrintAns(Nfigure(0, mwVarargin()));
}
//
// ax = axes('units','normal','Position', position);
//
ax
= Naxes(
1,
mwVarargin(
_mxarray43_,
_mxarray69_,
_mxarray65_,
mwVv(position, "position")));
//
// set(ax,'units',get(gcf,'defaultaxesunits'))
//
ans.EqPrintAns(
Nset(
0,
mwVarargin(
mwVv(ax, "ax"),
_mxarray43_,
mwVe(Nget(1, mwVarargin(mwVe(gcf()), _mxarray37_))))));
//
// else
//
} else {
//
// ax = gca;
//
ax = gca(mwArray::DIN);
//
// end
//
}
//
//
//
// % return identifier, if requested:
// if(nargout > 0)
//
if (nargout_ > 0) {
//
// theAxis = ax;
//
theAxis = mwVsv(ax, "ax");
//
// end
//
}
return_:
mwValidateOutput(theAxis, 1, nargout_, "theAxis", "subplot");
return theAxis;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -