Matlab 在绘图上没有显示足够的数字

标签 matlab plot axis digit

我想在 MATLAB 中绘制图形,但它显示 x Axis 为 x10^6 ! 我怎样才能让它显示 10 000 000 ?参见下图。

enter image description here

    frequency=[9999445,9999475,9999500,9999517,9999543,9999562,9999580,9999604,9999626,9999647,9999668,9999688,9999705,9999730,9999755,9999780,9999800,9999830,9999847,9999862,9999883,9999900,9999920,9999930,9999950,9999985,9999994,10000000,10000010,10000018,10000026,10000032,10000039,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045,10000045];
 temperature=[283,293,299,303,306,309,312,315,318,320,323,326,328,330,333,336,338,342,343,345,348,350,352,353,353,357,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354];
 time=[1:10:540]


 %plot(frequency)
 %figure,plot(temperature)

 figure,plot(frequency,temperature);

最佳答案

您可以对当前 Axis 的XTickLabel属性使用set函数。

一个例子是这样的:

x=[999 1000 1001 1002 1003];
y=3*x;
plot(x,y);
set(gca, 'XTick', x, 'XTickLabel', sprintf('%4.0f|', x));

enter image description here

根据您的情况,您可以这样做:

x=linspace(min(frequency),max(frequency),5);
figure,plot(frequency,temperature);
set(gca, 'XTick', x, 'XTickLabel', sprintf('%7.0f|', x));

enter image description here

您可以更改 5 值以增加或减少刻度。

关于Matlab 在绘图上没有显示足够的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21352223/

相关文章:

python - 将带有子图的 Pandas 图保存到一个文件中

具有排序顺序的 MATLAB 图

web-services - 在 SOAPUI 中测试安全的 Web 服务

java - 在现有的 Axis 1.4 web 服务中从 Spring 2.5 迁移到 3

matlab - playaudio()函数在 Octave 中不起作用

image - 如何在 MATLAB 中创建复古图像?

r - CorrPlot 无法在 R 中生成热图

java - 带有 AXIS 服务器的 JAX-WS 客户端;响应中缺少 namespace

matlab - 由于使用变量 'A' 的方式,Parfor 无法运行

matlab - 计算两幅图像之间的模糊核