Hello, I have multiple plots to do using "hold all" and a for loop. However, I want to also add a legend every time I generate a new plot while keeping the old legends. How can I do that? Part of my code is as follows:
------------------------------figure subplot(2,2,1) plot(t,H(1,:)), xlabel('t [s]'), ylabel('H [m]') for i =2:n % holds old plot for multi-line plots
hold all plot(t,H(i,:)), xlabel('t [s]'), ylabel('H [m]') end
Thanks in advance 🙂
Best Answer