Plot imagesc on Discontinuous x-Axis with datenum

3 views (last 30 days)
I have an imagesc to plot with distance on y axis, z in colorbar, and datenum on x axis. Y and Z are in the matrix (120 x 500) and datetime is in seperate vector t (120 x 1).
I have the following code to plot the imagesc and t, but t only covers data between 6am and 6pm.
How could it make a break in the plot with only showing data for 12 hours with then a break in for example dashed line?
Also, could it be possible to only show the day with the start time and end time (so no label for every xtick)?
figure
tnum = datenum(t);
imagesc(D', 'Interpolation', 'bilinear', 'XData', tnum);
set(gca, 'YDir', 'normal');
colorbar
xticks(tnum);
datetick('x', 'HH:MM', 'keepticks')
set(gca, 'XTickLabelRotation', 45)

Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!