How to plot like the following figure in Matlab?

조회 수: 2 (최근 30일)
Yukai Xu
Yukai Xu 2022년 8월 29일
댓글: Yukai Xu 2022년 8월 30일
Hello! How can I plot mutiple figures within one axis frame like following?
And if anyone knows, how to plot F0 like the bottom panel?
Any help would be highly appreciated!
Figure from: McGettigan et al. Trends Cogn Sci. 2012.

답변 (1개)

Karim
Karim 2022년 8월 29일
Yes, to omit some data points you can introduce NaN into the y data. See below for an example.
x_data = 1:100;
y_data = rand(1,numel(x_data));
% pick some random skip indexes...
idx = randi(numel(x_data)-15 ,4); % here we pick random start position to introduce the nan's
idx_len = randi(15,4); % pick some randm length's for the nan list...
for i = 1:numel(idx)
y_data(idx(i):(idx(i)+idx_len(i))) = nan;
end
figure
plot(x_data,y_data,'Color','r')
grid on
  댓글 수: 3
Rik
Rik 2022년 8월 30일
Why not? You want a red line graph with multiple sections. This code shows you how you can produce such a graph.
Yukai Xu
Yukai Xu 2022년 8월 30일
But that panel is ploting fundamental frequency of one audio... I plotted it with pitch fuction but the graph looks off.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by