How Do I Remove Scientific Notation From X/Y Axes on Plot
조회 수: 28 (최근 30일)
이전 댓글 표시
I do not want MATLAB to put the X10 scientific notation at the top of the Y axis ao at the right side of the X axis.
I have tried to using:
ax.XAxis.Exponent = 0
and
ax = gca;
ax.XRuler.Exponent = 0;
This has not worked. The best it will do is turn the numbers on the x axis to something like 0.000001 0.000003 ect.
I need it to just put 1 3 5 etc and let me note the notation in the x and y titles.
In other words, I want it to leave the numbers is is putting beside the X and Y axis but not put the X10^3 and X10^-6 at the ends of the X and Y axis lines.
Can you help?
Thanks,
댓글 수: 0
답변 (2개)
Voss
2022년 3월 18일
Multiply your data by the appropriate factor.
x = (1:10)*1e-6;
y = (1:10)*1e-3;
figure();
plot(x,y); % original plot, with exponents
xlabel('x');
ylabel('y');
figure();
plot(x*1e6,y*1e3); % new plot with data scaled appropriately
xlabel('x (*1e-6)');
ylabel('y (*1e-3)');
댓글 수: 0
Star Strider
2022년 3월 18일
Perhaps something like this —
x = logspace(-6, -2, 250);
y = sin(2*pi*3*x/x(end));
figure
semilogx(x, y)
grid
figure
semilogx(x, y)
grid
Ax = gca;
xt = Ax.XTick;
Ax.XTickLabel = log10(xt);
.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



