very interesting phenomenon about 'loglog semilogy'

1 visualizzazione (ultimi 30 giorni)
Lion
Lion il 3 Dic 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!

Risposte (1)

Khaled Hamed
Khaled Hamed il 3 Dic 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'.

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by