How to scale an axis on a plot in powers of 10?

66 visualizaciones (últimos 30 días)
Fanatic
Fanatic el 20 de Sept. de 2020
Comentada: Star Strider el 20 de Sept. de 2020
I have a plot of experimental data and the x-axis is scaled from to , but I want it to be scaled in powers of 10 from to . What could I do to fix this axis scaling issue?
Any help would be greatly appreciated!

Respuesta aceptada

Star Strider
Star Strider el 20 de Sept. de 2020
Set xlim to the limits you want.
Example —
x = logspace(5, 6, 25); % Create Data
y = rand(size(x)); % Create Data
figure
semilogx(x, y)
grid
xlim([1E2 1E6])
.
  2 comentarios
Fanatic
Fanatic el 20 de Sept. de 2020
Thank you, it worked!
Star Strider
Star Strider el 20 de Sept. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by