功率谱结果绘图,横坐标设置

%画图~以f为横坐标,功率谱值为纵坐标,但是把相应位置的f改成对应周期,f本身画到上面的横坐标去
position = [0.1 0.15 0.8 0.3];

plot(east_ciso_f, east_ciso_S ,LineWidth=2) % 连续功率谱
ylim([-0.01 0.1]);%xlim([1/365 0.5])
hold on; plot(east_ciso_f, sw, 'r--',LineWidth=2) % 检验线
%set second xtick~~~
xticks([0 1/30 1/15 0.1 0.2 0.3 0.5]);%想显示的值标出来
f = xticks;
xticklabels(sprintfc('%.0f',1./f));%精度保留0位小数~f换成倒数就是周期啦~
set(gca,'xaxislocation','bottom','position',position);
xlabel('period (days)')
%x of f on the top:
axes;
plot(east_ciso_f,east_ciso_S,LineWidth=2 ) % 连续功率谱
hold on; plot(east_ciso_f, sw, 'r--',LineWidth=2) % 检验线
set(gca,'xaxislocation','top','position',position);
ylim([-0.01 0.1])% xlim([2 30]);
legend('功率谱S','红噪声谱Sw')
xlabel('频率f') ;ylabel('power spectrum') ;

% line of time
subplot("Position",[0.1 0.6 0.8 0.3])
plot(x,east_ciso,LineWidth=2) 
xlim([x(1) x(365)]) %去掉了两头留白
datetick('x','mm','keeplimits') %datetick('x','mm','keepticks')%这比上一条指令在末尾多了个1
hold on
p=refline([0 mean(east_ciso)]); %参考线
set(p,"Color",'green','LineWidth',2)
title('东区多年平均时间序列');
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值