필터 지우기
필터 지우기

How can I change the axis intervals using powers?

조회 수: 26 (최근 30일)
Md Affan
Md Affan 2024년 7월 4일 6:24
댓글: Voss 2024년 7월 4일 22:19
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)

채택된 답변

Voss
Voss 2024년 7월 4일 6:37
  댓글 수: 4
Md Affan
Md Affan 2024년 7월 4일 17:18
Thank you!
Voss
Voss 2024년 7월 4일 22:19
You're welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by