How Do I Remove Scientific Notation From X/Y Axes on Plot
Afficher commentaires plus anciens
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,
Réponses (2)
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)');
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);
.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



