Matlab图:用自定义标签替换xaxis

问题描述 投票:0回答:1

我有一个图形,想将绘图的 x 轴替换为自定义轴。现在 x 轴上有从 0 到 300 的值,但我需要它在图形的整个宽度上以相等的距离显示从 1 到 10 的值。我该怎么做?

这是图和代码,如果有帮助的话:

link to imgage

sun = dataset.sun
%time = dataset.time

figure
plot(sun)

到目前为止,我尝试了一些操作现有 x 轴的选项,但到目前为止还没有真正成功。

matlab plot axis figure
1个回答
0
投票

如果你不想像评论那样明确设置

time
, 您可以使用 axis() 修改轴边界。 https://au.mathworks.com/help/matlab/ref/axis.html

axis([0 10 0 inf]) % array follows [xmin, xmax, ymin, ymax]
© www.soinside.com 2019 - 2024. All rights reserved.