How Do I Remove Scientific Notation From X/Y Axes on Plot
28 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Voss
on 18 Mar 2022
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 Comments
Star Strider
on 18 Mar 2022
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


