# Rescaling ColorFunction for Heat Maps

I've been looking around example of rescaling color gradients but I couldn't find any workable solution for my system. I'm importing several .dat files and want to represent similar data with similar color ranges. Essentially, I'd like to rescale the color gradient start/end points to make everything consistent, where the .dat file contains a 2D array of data with z-values that should be colored the same. This is what I have so far:

color= ColorData["DeepSeaColors"];

graph = MatrixPlot[arrayData,
ColorFunctionScaling -> False, ColorFunction -> (cf@Rescale[#3, {200, 805}] &),
GridLines -> Automatic, PlotLegends -> Automatic, Frame -> False, Axes -> False,
Mesh -> Automatic, MeshStyle -> Black,
LabelStyle -> Directive @@ {FontFamily -> "Helvetica", 18, FontColor -> Black},
PlotRange -> {200, 805},
BaseStyle -> Directive @@ {FontFamily -> "Helvetica", 18, FontColor -> Black}];


Unfortunately I just get a bunch of red cubes currently!

• Can you provide arrayData? Otherwise it is going to be guess work. – user21 Jun 23 '17 at 17:26
• use cf@Rescale[#, {200, 805}] & instead of cf@Rescale[#3, {200, 805}] &? – kglr Jun 23 '17 at 20:13
• I think it worked with the # rather than #3, thanks! – Bobby Jun 23 '17 at 20:46
• @Bobby, i posted the comment as an answer. – kglr Jun 23 '17 at 21:06

SeedRandom[1]