function Axes = setAxesScaleAndLimits(Axes, VarSpec)
%

    %   Copyright 2016-2022 The MathWorks, Inc.

if VarSpec.isLog(1) && VarSpec.LBs(1)~=0
    Axes.XScale = 'log';
    Axes.XLim = [VarSpec.LBs(1), VarSpec.UBs(1)];
end
if VarSpec.isCat(1)
    cats = categories(VarSpec.Categories{1});
    Axes.XTick = 1:numel(cats);
    Axes.XTickLabel = cats;
    Axes.XTickLabelRotation = 45;
end
if VarSpec.NumVars > 1
    if VarSpec.isLog(2) && VarSpec.LBs(2)~=0
        Axes.YScale = 'log';
        Axes.YLim = [VarSpec.LBs(2), VarSpec.UBs(2)];
    end
    if VarSpec.isCat(2)
        cats = categories(VarSpec.Categories{2});
        Axes.YTick = 1:numel(cats);
        Axes.YTickLabel = cats;
        Axes.YTickLabelRotation = 45;
    end
end
end