필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do I use an unusual base in a semilogx plot?

조회 수: 1 (최근 30일)
Ryan Consell
Ryan Consell 2020년 10월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
Is it possible to plot data against an x-axis with a log base 1.85 axis? The default is log base 10, and I've found a way to do log base 2, but not odd values.
Thanks!

답변 (1개)

Star Strider
Star Strider 2020년 10월 20일
See if this works for what you want to do:
x = 1:5;
y = 1.85.^x;
figure
subplot(2,1,1)
semilogx(x, y) % Original Plot
grid
subplot(2,1,2)
semilogx(x, y)
grid
Ax = gca;
xt = Ax.XTick;
xtl = compose('%.1f', log10(xt)./log10(1.85));
Ax.XTickLabel = xtl; % New ‘x’-Axis LAbels
Check = 1.85.^(log10(xt)./log10(1.85)); % Check Appropriate Conversion (Delete)
.

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by