function f = mygetframe( theaxes )
%f = mygetframe( theaxes )
%   Like getframe(), but brings the axes to the front.

    if nargin==0
        theaxes = gca;
    end
  % axes( theaxes );
    try
        f = getframe( theaxes );
    catch
        e = lasterror();
        f = [];
        fprintf( 1, '** Warning: getframe() failed: "%s"\n', ...
            e.message );
    end
end
