Use NaN to remove unwanted gap due to missing data in a Plot

9 views (last 30 days)
How do I use NaN to remove the part of the plot between 13:00 and 15:00 due to missing time in the data?
I made a plot with incomplete data and arrived at Image_Plot attached.
Part of the code below. Is there any other method?
test_height(test_height==0) = nan;
height = mean(test_height,2,'omitnan');
test_zh(test_zh==0)=nan;
%pcolor(time,height,(test_zh))
%shading flat
%colormap jet
%colorbar
%caxis([0 30])
heights=height+2.8281;
figure('position',[50 100 1400 300])
pcolor(time,heights,(test_zh))
%pcolor(datenum(time),rng,zh)
datetick('x')
shading flat
set(gca,'color','w','LineWidth',1,'fontweight','normal','fontsize',10);
set(gca, 'TickDir','none')
xlabel('Time (UTC)','FontSize',12,'FontWeight','normal','color','k');
ylabel('Height (km)','FontSize',12,'FontWeight','normal','Color','k');
ylim([3 6])
caxis([-10 30])
  1 Comment
Image Analyst
Image Analyst on 25 Jul 2022
You forgot to attach the data.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!