very interesting phenomenon about 'loglog semilogy'

1 Ansicht (letzte 30 Tage)
Lion
Lion am 3 Dez. 2012
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!

Antworten (1)

Khaled Hamed
Khaled Hamed am 3 Dez. 2012
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'.
  1 Kommentar
Lion
Lion am 3 Dez. 2012
Thanks very much. That is the solution. Thanks very much

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by