very interesting phenomenon about 'loglog semilogy'

1 次查看(过去 30 天)
Dear Matlab workgroup:
I found a interesting phenomenon when I used semilogy or loglog command to draw a graph. For the arrays has several index, and I used
for i_num = 1: err_index(3)
loglog(2:size(csr_err,2)-1, csr_err(i_num, 3:end),'-','linewidth',1.6, 'color','r');
end
csr_err_mean = mean(csr_err, 1);
loglog(2:size(csr_err,2)-1, csr_err_mean(3:end),'-','linewidth',1.6, 'color','k');
when I directly used as shown above, the graph shows not log map but a regular map. when I use loglog for one data series and then ran the commond above,it give the needed log-map, why this happens. could you give me some suggestions? Thanks a lot.
Have a nice day!

回答(1 个)

Khaled Hamed
Khaled Hamed 2012-12-3
You must have had 'hold on' before the loop in order not to overwrite plots. If this is the case, a linear scale is always held. If this is the case, the solution is to remove 'hold on' or start a new figure before starting the loop, then insert 'hold on' after the 'loglog' command and before 'end'.

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by