I use the following code to plot my 2D map. I would like to increase the contrast in Z scale in order to see better the details in the blue area (-0.5 to 0) and red area (0.5 to 1) better and put in white all the data between 0 and 0.5. I don't see how to do it (I tried RegionFunction
). In attached the picture I get and the data can be found here or here.
SetDirectory[NotebookDirectory[]];
file = FileNames["*.dat", NotebookDirectory[]];
func[file_String /; FileExistsQ[file]] :=
Module[{data, dataT}, data = Import[file, "Table", HeaderLines -> 2];
dataT = Transpose[data];
dataT = {dataT[[1]]*10, dataT[[2]]*10,
dataT[[3]]}; (*je converti de angtroms a nano*)
dataT[[3]] = Rescale[dataT[[3]], MinMax[dataT[[3]]], {-1., 1.}];
data = Transpose[dataT];
graph = ListDensityPlot[data,
PlotLabel -> FileBaseName[file],
PlotRange -> {{-0.5, 0.5}, {-0.5, 0.5}, {-1., 1.}},
ColorFunction -> (ColorData[{"TemperatureMap", {-0.8, 0.8}}])]
]
func /@ file
myTemperatureMap[f_] := Blend[{{0., Blue}, {.25, Lighter@LightBlue}, {.25, White}, {.75,White}, {.75, Yellow}, {1., Red}}, f]
... I tried it, but the results are exaggerated. $\endgroup$