set x-axis in semilogx plot
10 ビュー (過去 30 日間)
古いコメントを表示
I'm tring to plot a graph with a logaritmic x-axis. I want the x-axis to go from zero to 10000.
However when i try the following code nothing happens. (result see attachment)
x = [10 100 2000 3400 5000];
y = [12 8 5 3 2];
semilogx(x,y);
xt = [0 1 10 100 1000 10000];
set(gca,'XTick',xt)
xlim([0 100000])
ylim([0 15])
How can i solve this?
2 件のコメント
William Alberg
2020 年 5 月 26 日
You cannot reach 0 on a logarithmic plot.
You can do the following:
x = [10 100 2000 3400 5000];
y = [12 8 5 3 2];
semilogx(x,y);
% xt = [0.1 1 10 100 1000 10000];
% set(gca,'XTick',xt)
xlim([0.1 100000])
ylim([1 15])
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!