adjust values on x-axis wcoherence

2 views (last 30 days)
CG
CG on 19 Aug 2024
Edited: praguna manvi on 20 Aug 2024
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')

Answers (1)

praguna manvi
praguna manvi on 19 Aug 2024
Edited: praguna manvi on 20 Aug 2024
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:

Community Treasure Hunt

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

Start Hunting!