function sub = mysubplot(THIS)
% MYSUBPLOT  [Not a public function] Compute subdivision of the figure window.
%
% Backend IRIS function.
% No help provided.

% -IRIS Toolbox.
% -Copyright (c) 2007-2012 Jaromir Benes.

%**************************************************************************

if strcmp(THIS.options.subplot,'auto')
    nchild = length(THIS.children);
    candidate = ceil(sqrt(nchild));
    if candidate*(candidate-1) >= nchild
        sub = {candidate,candidate-1};
    else
        sub = {candidate,candidate};
    end
else
    sub = {THIS.options.subplot(1),THIS.options.subplot(2)};
end

end
