How changing the loglog scale x and y axis?
조회 수: 5 (최근 30일)
이전 댓글 표시
I need to represent numbers from 0.5 to 50 (0.5 5 50) instead of 1 10 100(standard log log scale) is it possible? how can i do?
댓글 수: 0
채택된 답변
Walter Roberson
2017년 10월 3일
x = sort( rand(1,40)*49.5 + 0.5 );
y = x.*abs(sin(x));
loglog(x,y)
xlim([0.5 50])
ylim([0.5 50])
nticks = 5;
tickpos = round( logspace(log10(0.5),log10(50), nticks) );
set(gca, 'XTick', tickpos, 'YTick', tickpos)
댓글 수: 2
Walter Roberson
2017년 10월 3일
tickpos = [0.5 5 50];
set(gca, 'XTick', tickpos, 'YTick', tickpos)
추가 답변 (1개)
David J. Mack
2017년 10월 3일
편집: David J. Mack
2017년 10월 3일
semilogy(x,y);
If you have to use loglog, use the 'XScale'-Property instead:
loglog(x,y);
set(gca,'XScale','linear');
In both cases you can set the x-tick & the x-axis limit, using:
set(gca, 'XTick',[0.5 5:5:50], 'XLim',[0.5 50]);
Greetings, David
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Red에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!