Plotting a rectangle with a heat map

Consider the two table set below

t1= {0.44, 0.62, 0.77, 0.87, 0.93, 0.96, 0.98, 1}
t2= {0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25}


how can I create a plot which wil plot a rectangle with a heat map normalized to the values of the table?

The result should look like

• A starting point could be: ArrayPlot[With[{n = 5}, ConstantArray[t1, n] ], ColorFunction -> "TemperatureMap"] May 30, 2019 at 8:28
• does Column[Quiet@DensityPlot[Interpolation[#][x], {x, 0, 1}, {y, 0, 1/5}, AspectRatio->Automatic,Frame -> False, PlotRangePadding->0,ImagePadding->0,ColorFunction->"Rainbow", ColorFunctionScaling->False, ImageSize->Medium]&/@{t1,t2}] give what you need?
– kglr
May 30, 2019 at 8:29

Function Blend actually does a great color interpolation. For simplicity assume that all your values are always in $$[0,1]$$ interval. Choose a specific Color Scheme, for example DeepSeaColors , and define:

cf[v_][x_] := Blend[ColorData["DeepSeaColors"] /@ v, x]


You do not have to use built in color schemes, you could just have assigned some colors to your numbers. The point is in blending them. Then using detailed Raster make:

Graphics[Raster[{Range[100]/100}, ColorFunction -> cf[t1]], AspectRatio -> .3]


Graphics[Raster[{Range[100]/100}, ColorFunction -> cf[t2]], AspectRatio -> .3]


It is not clear from your question how exactly you want to rescale / normalize. But you can always use Rescale to adjust the above aproach.

Column[Quiet @ DensityPlot[Interpolation[#][x], {x, 0, 1}, {y, 0, 1},
AspectRatio -> 1/5, Frame -> False, ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, ImageSize -> Medium] & /@ {t1, t2}]


Another idea is to use VertexColors option of Line (or Rectangle):

Graphics[
{
Thickness[.4],
},
AspectRatio->1/4
]