1
只是想添加更多的數據做一個圖例而不刪除它。 。Matlab動態圖例/圖例「hold on」like behavior
plotData
=陣列繪圖數據,如plotData(I)=圖(...
N
=大小plotData的
樣品 「擱置」
代碼:
for i = 1:N
str = sprintf('My plot y %d', i);
%legendData(:,i) = [plotData; str]; %#ok<SAGROW>
%[~,~,~,current_entries] = legend;
%legend([current_entries [plotData; str]]); no sucess here
% This command will erase the previous one.
legend(plotData,str);
end
legend([plotX1,plotX2],'x 1','x 2');
我想我可以存儲從環傳說的信息和某種方式把它添加到最後一行,像:
legend(DATAFROMLOOP?? [plotX1,plotX2],'x 1','x 2');
這是一個可能的解決方案,但我不知道該怎麼做。