very interesting phenomenon about 'loglog semilogy'

1 回表示 (過去 30 日間)
Lion
Lion 2012 年 12 月 3 日
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'.
  1 件のコメント
Lion
Lion 2012 年 12 月 3 日
Thanks very much. That is the solution. Thanks very much

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by