! Example of heatmap with black/white numeric labels. ! Author: Francois Tonneau size 22 14 set font ss hei 0.3 include palettes.gle ! Draw the frame around the map via a graph block. amove 3 2 begin graph size 14 10 fullsize xaxis min 0 max 12 ftick 0.5 dticks 1 yaxis min 0 max 12 ftick 0.5 dticks 1 xtitle Year adist 0.9 ytitle Month adist 1.2 side off ticks off xlabels off x2labels off ylabels off y2labels off labels hei 0.4 data "heatmap.dat" xnames 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 ynames Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan end graph ! Draw the map. low = 100 high = 630 dx = xg(2) - xg(1) dy = yg(2) - yg(1) sub adjusted z return (z - low) / (high - low) end sub for col = 1 to ndatasets() n = ndata(d[col]) for row = 1 to n z = datayvalue(d[col], row) amove xg(col - 1) yg(n - row) set color white lwidth 0.01 box dx dy just bl fill magma(adjusted(z)) rmove 0.33 0.32 set color magma_text(adjusted(z)) write z next row next col ! Add a custom color ramp on the right. low = 70 ! => stretch the ramp down for prettier looks high = 630 dy = 0.015 amove 19 2.8 for z = low to high set color magma(adjusted(z)) lwidth 0 box 0.8 dy just bl fill magma(adjusted(z)) rmove 0 dy next z set color gray50 lwidth 0.03 just lc amove 20 2.8+(30*dy) for tick = 100 to 600 step 100 write tick rmove 0 1.5 next tick