Putting a step in x axis

2 次查看(过去 30 天)
Hi,
I'm trying to put the x axis with a step of 50 nm, but the output is 0 to 350 nm instead of 0 to 3600 nm.
subplot(2,1,2);
plot(lambda./1e-9, t/1e-9);
grid on;
axis tight;
set(gca,'XTickLabel', 0:50:3600);
xlabel('Comprimento de Onda [nm]');
ylabel('Espessura mínima [nm]');
What I'm doing wrong?
Thanks!

采纳的回答

VBBV
VBBV 2020-11-26
编辑:VBBV 2020-11-26
%if true
set(gca,'XTicks', 0:50:3600);
xlabel('Comprimento de Onda [nm]');
ylabel('Espessura mínima [nm]');
Use XTicks
  8 个评论
VBBV
VBBV 2020-11-27
I think you are dividing lambda with 1e-9 which gives you a large number. You have ylabel and xlabel in nm. So you should multiply with 1e-9 in plot.
%if true
subplot(212)
plot(lambda.*1e-9,t*1e-9)
Oliver Lestrange
Oliver Lestrange 2020-11-27
I solved it with xtick instead of XTickLabel.
Thanks a lot VBBV!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by