フィルターのクリア

Log axis on imagesc

32 ビュー (過去 30 日間)
Cl
Cl 2014 年 3 月 10 日
コメント済み: Sean de Wolski 2014 年 3 月 10 日
I've plotted an image using imagesc:
figure;
imagesc([pmin pmax], [vmax vmin],flipud(result.^2))
xlabel('Period (s)','FontSize',20)
ylabel('Velocity (m.s^-^1)','FontSize',20)
set(gca,'ydir','normal')
and would like to make the x-axis logarithmic. If I just do set(gca, 'XScale','log') it changes the scale but not the image. How can I change the image and the scale? I've tried plotting with surf as well, but that's not producing what I want. My xscale values are 2:0.1980:101, so I'm not sure what the best way of plotting this is. Any suggestions are much appriciated!

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 3 月 10 日
I think what you want is to use surf with x and y set to your values.
surf(1:100,1:100,magic(100));
set(gca,'XScale','log');
view(2)
If this isn't correct, could you attach your data in a zip file?
  2 件のコメント
Cl
Cl 2014 年 3 月 10 日
Thanks for your response. When using set(gca, 'XScale','log') how does this decide how the values are split up? When I use
surf(result.^2,'LineStyle','none')
view(0,90)
set(gca, 'XTick',pmin:(pmax-pmin)/10:pmax ,'XTickLabel', round(pmin:(pmax-pmin)/10:pmax), 'FontSize',16)
xlabel('Period (s)','FontSize',20)
ylabel('Velocity (m.s^-^1)','FontSize',20)
I just get the first 10 values used for the 0:10 section, which isn't correct. I'm not sure where I'm going wrong with that
Sean de Wolski
Sean de Wolski 2014 年 3 月 10 日
I'm not able to reproduce what you're describing (guessing at pmin, pmax)
surf(1:100,1:100,magic(100));
set(gca,'XScale','log');
view(2)
set(gca,'XTick',2:(pmax-pmin)/10:102,'XTicklabel',round(2:(pmax-pmin)/10:102))

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by