Prevent plot() filling missing data between points
13 次查看(过去 30 天)
显示 更早的评论
I have the plot belo where x=datenum and y=SPL. You can see, particularly in the second plot down, that there are periods where the data 'jumps'. This is because there are some missing days in the dataset. How do I leave these periods blank rather than having Matlab fill them in automatically? This is sound data so it is not correct to interpolate between the two points like this.
%all subplots use the same approach:
subplot(5,1,1)
X = [dBcalc_goat(:,1)' fliplr(dBcalc_goat(:,1)')];
Y = [dBcalc_goat(:,7)' fliplr(dBcalc_goat(:,10)')];
fill(X,Y,[0.929411764705882 0.694117647058824 0.125490196078431],...
'EdgeColor',[0.929411764705882 0.694117647058824 0.125490196078431]);
hold on
plot(dBcalc_goat(:,1),dBcalc_goat(:,5),'Color',[1 0 0],'LineWidth',2); %RMS level
plot(dBcalc_goat(:,1),dBcalc_goat(:,4),'Color',[ 0 0 0]); %median
plot(dBcalc_goat(:,1),dBcalc_goat(:,7),'Color',[0.929411764705882 0.694117647058824 0.125490196078431]); %5th percentile
plot(dBcalc_goat(:,1),dBcalc_goat(:,10),'Color',[0.929411764705882 0.694117647058824 0.125490196078431]); %95th percentile
xlim([first last]);
xticks([])
ylim([100 140])
xline(winter_19,'--');
xline(spring_19,'--');
xline(summer_20,'--');
xline(autumn_20,'--');
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!