How to plot like the following figure in Matlab?
1 次查看(过去 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.
0 个评论
回答(1 个)
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!