function SaveFigure(fig, filename)

    saveas(fig, filename);
    X = imread(filename);
    X = TrimLR(X);
    X = TrimTB(X);
    imwrite(X, filename);
end

