When you call linkaxes, it sets the XLimMode and YLimMode to 'manual' on each of the axes. Without it, they are set to 'auto'.
When you zoom for the first time, it stores the XLim and YLim values and resets to those values when you reset except if XLimMode and YLimMode (or any mode property related to a property that interactions set) is auto, in which case it sets the XLimMode and YLimMode back to 'auto'.
In this case, the zoom is going back to the stored (original) XLim and Ylim values (0-5 for XLim), instead of going back to the 'auto' position for the data.
In order to have the behavior go back to the 'auto' position for linkedaxes, use one of these two methods:
1. Set the XLimMode and YLimMode back to 'auto' after executed linkaxes:
2. Execute zoom reset whenever the data is switched. This will set the home limits to the current limits (or to 'auto' if they are in 'auto'):
Best Answer