very interesting phenomenon about 'loglog semilogy'

1 view (last 30 days)
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!

Answers (1)

Khaled Hamed
Khaled Hamed on 3 Dec 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'.

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!