How to remove or add portions of the x-axis that isn't being used
5 views (last 30 days)
Voss on 10 Dec 2021
Edited: Voss on 10 Dec 2021
There are different ways to do it:
xlim('tight'); % option 1
xlim([-4 5]); % option 2
set(gca(),'XLim',[-4 5]); % option 3
It looks like you've used subplot to get the two axes, so note that you have to set the x-limits for each one (unless they're linked).
Slimiar functionality exists for the y-limits: use ylim or set the 'YLim' of the axes.