when I run this code I have 192 months on the x-axis.
I want to show each year (Jan1971,Jan 1972,…Dec 1986) on the x axis. if I do:
set(h,'XTick',datetime('Jan-1971'):calmonths(12):datetime('Dec-1986'));
I have this error:
Error using matlab.graphics.chart.HeatmapChart/set
The name 'XTick' is not an accessible property for an instance of class 'matlab.graphics.chart.HeatmapChart'.
could you please help me to solve the problem.
tbl = readtable('heatmap.test.xlsx');t1 = datetime(1971,1,1);t2 = datetime(1986,12,1);t = t1:calmonths(1):t2;t= t(:);xlabels = string(datestr(t,12));ylabels = {'A' 'B' 'C' 'D'};cdata = tbl{:,2:5};h = heatmap(xlabels,ylabels,cdata');
Best Answer