How can I change the axis intervals using powers?

Hi.
I recently was trying to make a scientific graph, which required the X Axis to be in even intervals of powers of 10 (i.e. 0.1, 10, 100, 1000, etc.) with no in-betweeners. When I tried to use the xtick function, the command worked, but it didn't create the necessary even spacing required at the intervals. What can I do? (The code and images are below.)
size = particle_size.("Size (d.nm)");
number = particle_size.("Number (Percent)");
plot(normalize(size,'range',[0.1 10000]),number,"red",LineWidth=0.5)
xlim([0.1 10000])
ylim([0 14])
title("Particle Size Of Carbon Leaves",FontSize=20,FontWeight="bold")
xlabel("Size (d.nm)",FontSize=14,FontWeight="bold")
ylabel("Number (Percent)",FontSize=14,FontWeight="bold")
legend("Carbon Leaves",FontWeight="bold")
xtick = [0.1, 1, 10, 100, 1000, 10000];
box on
ax = gca;
ax.LineWidth = 2;
ax.FontSize = 12;
ax.XTick = xtick;
The graph required to make
(The graph required)
What Matlab Showed Me
(What MATLAB gave me)

 Respuesta aceptada

Voss
Voss el 4 de Jul. de 2024

0 votos

4 comentarios

Md Affan
Md Affan el 4 de Jul. de 2024
Thanks for the solution! The only problem left here is that I want to hide the lines which are in between the powers of 10. Is there a way to remove that?
Voss
Voss el 4 de Jul. de 2024
ax.XMinorTick = 'off';
Md Affan
Md Affan el 4 de Jul. de 2024
Thank you!
Voss
Voss el 4 de Jul. de 2024
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Polar Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2024a

Etiquetas

Preguntada:

el 4 de Jul. de 2024

Comentada:

el 4 de Jul. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by