I run
loglog(x,y); legend(\'First script\');
from the first script. Then, hold on;. I run a similar second script. I see two g
hold on;
plot(x,y); legend('y'); hold on; plot(x,z); hold off; % Now add a new item to the legend h = legend(); newleg = h.String; newleg{end+1} = 'z'; legend(newleg);