Hi Globi,
As per my understanding, the issue you are facing is due to how ‘pzmap()’ behaves when used inside a subplot. Unlike ‘plot()’, which respects the current axes, ‘pzmap()’ creates a new axes object by default. This causes it to overwrite the existing subplot, even if ‘hold on’ is used.
To prevent ‘pzmap()’ from overwriting the subplot, you can explicitly pass the axes handle to it. Here is how you can modify your function:
function plotPZStuff_subplot(ss)
ax = subplot(1,2,1); % Get handle to the subplot axes
hold(ax, 'on') % Hold on for that specific axes
pzmap(ax, ss) % Pass the axes handle to pzmap
end
This ensures that ‘pzmap()’ plots into the correct subplot without creating a new axes object.
The output will look like this:

For more details, refer:
