adjust values on x-axis wcoherence

4 次查看(过去 30 天)
CG
CG 2024-8-19
I have plotted wavelet coherence for my dataset and have got the following plot. However my time series spans 600 years - 1000 years, yet this is being plotted from 0 - 400 years in the plot. Is there a way I can get the x-axis to be automatically plotted over the correct time period? I need phase arrows so I dont want to plot this manually.
Ts = 0.74;
ti = [mint2:Ts:maxt1]';
data_1_interp = interp1(timeseries1(:,1),timeseries1(:,2),ti);
data_2_interp = interp1(timeseries2(:,1),timeseries2(:,2),ti);
wcoherence(data_1,data_2,years(Ts),'phasedisplaythreshold',0.75)
colormap(turbo)
xline([800 1200],'white','Linewidth',4)
xlabel('Time')
ylabel('Period')

回答(1 个)

praguna manvi
praguna manvi 2024-8-19
编辑:praguna manvi 2024-8-20
Hi @CG,
To visualize the timespan of 800-1000 years on the x-axis in the "wcoherence" plot, you can adjust the sampling interval "Ts." The sampling interval "Ts" specifies the duration between two consecutive points in the data. In this case, it is set to "0.74 years." Consequently, the timespan on the x-axis will scale to "length(data) × 0.74," which might result in a 0-400 range on the x-axis in the visualization.
For more details on how "Ts" affects the plot, you can refer to the MathWorks documentation provided here:

类别

Help CenterFile Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by