Hi
I want to write a word with subscription in ylabel of the heatmap.
but is shows: A_b
how can I edit this?
how can I show the xlable values as yearly (1971,1972,…)?
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' 'B_b' 'C_b' 'D_b'};cdata = tbl{:,2:5};h = heatmap(xlabels,ylabels,cdata');idx = [true;diff(year(t))] ~=0; % index of datetime values to show as x tick
h.XDisplayLabels(~idx) = {''};
Best Answer