set x-axis in semilogx plot
조회 수: 11 (최근 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!