Plot imagesc on Discontinuous x-Axis with datenum
3 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calendar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!