%% Specify Tight x-Axis Limits
% If you want the x-axis to automatically adjust to match the range of your x-coordinates, use the 'tight' limit method.
% Create a line plot.

plot([1 2 3 4 5 6.3],[0 0.3 0.1 0.6 0.4 1])

%
% Change the limit method to 'tight'.

xlim tight

%
% Add another plot to the axes. The x-axis limits adjust to encompass the span of the new data.

hold on
plot([1 2 3 4 5 8.3],[0.1 0.2 0.3 0.4 0.5 0.83])
hold off

% Copyright 2020 The MathWorks, Inc.