Options[sinhcontourplot] = {"Color" -> (Blend[ Apply[RGBColor, cMap, {1}], #1] &), "ImageHeight" -> 500, "LegendHeight" -> 300, "ComplexSignal" -> False, "LinearScaling" -> False, "PlotRange" -> "Automatic", "ThickContours" -> True, "LegendTickFontSize" -> 20, "LegendOrientation" -> "Vertical", "ScaleFactor" -> 1, "YTicks" -> "Automatic", "AbsoluteScaling" -> False}; sinhcontourplot[ list_, {prefactor_, xrange_, yrange_, ncontours_, plotopts : OptionsPattern[]}, OptionsPattern[]] := Module[{absplot, absplotlegend, reimplotlegend, fticks, implot, replot, contours, contourstyle, imticks, absticks, reticks, xrange2, yrange2, fyticks, fryticks, sciform, absmax, reimmax}, sciform[x_] := If[0.05 <= Abs[x] <= 99 || x == 0, NumberForm[x, 2], ScientificForm[x, 2, NumberFormat -> (Row[{#1, "e", #3}] &)]]; absmax = Max[Abs[list]]/OptionValue["ScaleFactor"]; reimmax = Max[Abs[Join[Re[list], Im[list]]]]/OptionValue["ScaleFactor"]; {xrange2, yrange2} = If[SameQ[OptionValue["PlotRange"], "Automatic"], {xrange, yrange}, OptionValue["PlotRange"]]; fticks = {LinTicks[xrange2[[1]], xrange2[[2]], MajorTickLength -> {0.025, 0}, MinorTickLength -> {0.015, 0}], LinTicks[yrange2[[1]], yrange2[[2]], MajorTickLength -> {0.025, 0}, MinorTickLength -> {0.015, 0}], StripTickLabels[ LinTicks[xrange2[[1]], xrange2[[2]], MajorTickLength -> {0.025, 0}, MinorTickLength -> {0.015, 0}]], StripTickLabels[ LinTicks[yrange2[[1]], yrange2[[2]], MajorTickLength -> {0.025, 0}, MinorTickLength -> {0.015, 0}]]}; fyticks = {fticks[[1]], fticks[[4]], fticks[[3]], fticks[[4]]}; fryticks = {fticks[[1]], fticks[[4]], fticks[[3]], fticks[[2]]}; {absticks, reticks, imticks} = Which[SameQ[OptionValue["YTicks"], "Automatic"], {fticks, fticks, fticks}, SameQ[OptionValue["YTicks"], "Offset"], {fticks, fyticks, fryticks}, SameQ[OptionValue["YTicks"], "None"], {fyticks, fyticks, fyticks}, SameQ[OptionValue["YTicks"], "Right"], {fryticks, fryticks, fryticks}]; contours = Drop[Table[n, {n, 0., 1., 1./ncontours}], 1]; contourstyle = If[OptionValue["ThickContours"], Transpose[{Table[Thick, {ncontours}], OptionValue["Color"] /@ contours}], OptionValue["Color"] /@ contours]; absplot = Module[{nlist, snlist, background}, nlist = Abs[list]/Max[Abs[list]]; snlist = If[OptionValue["LinearScaling"], nlist, ArcSinh[prefactor*nlist]]; snlist = OptionValue["ScaleFactor"] snlist/Max[snlist]; tempzds = snlist; test123 = snlist; ListContourPlot[Abs[snlist], PlotRange -> {xrange2, yrange2, Full}, Contours -> contours, ContourStyle -> contourstyle, Evaluate[FilterRules[{plotopts}, Options[ListContourPlot]]], ContourShading -> False, ColorFunction -> OptionValue["Color"], ImageSize -> {Automatic, OptionValue["ImageHeight"]}, AspectRatio -> Automatic, DataRange -> {xrange, yrange}, PlotRangePadding -> None, FrameStyle -> Directive[Thick, Black], FrameTicks -> absticks, ColorFunctionScaling -> False]]; absplotlegend = If[SameQ[OptionValue["LegendOrientation"], "Vertical"], DensityPlot[y, {x, 0, 10}, {y, -0.005, 1.005}, ColorFunction -> OptionValue["Color"], AspectRatio -> 10, PlotRangePadding -> None, BaseStyle -> {OptionValue["LegendTickFontSize"], FontFamily -> Times}, FrameTicks -> {None, None, None, If[OptionValue["LinearScaling"], LinTicks[ If[OptionValue["AbsoluteScaling"], {0, 0.5 absmax, 1 absmax}, {0, 0.5, 1}], If[OptionValue["AbsoluteScaling"], {0.25 absmax, 0.75 absmax, Null}, {0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, MajorTickLength -> {0.5, 0.1}, MinorTickLength -> {0.5, 0.2}, TickPostTransformation -> If[OptionValue["AbsoluteScaling"], (#1/absmax &), (#1 &)], TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)]], LinTicks[ If[OptionValue["AbsoluteScaling"], {0, 0.2 absmax, 0.4 absmax, 1 absmax}, {0, 0.2, 0.4, 1}], If[OptionValue["AbsoluteScaling"], {0.6 absmax, 0.8 absmax, Null}, {0.6, 0.8, Null}], TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (ArcSinh[#1*prefactor/absmax]/ ArcSinh[prefactor] &), (ArcSinh[#1*prefactor]/ ArcSinh[prefactor] &)], MajorTickLength -> {0.5, 0.1}, MinorTickLength -> {0.5, 0.2}]]}, ImageSize -> {Automatic, OptionValue["LegendHeight"]}], DensityPlot[y, {y, -0.005, 1.005}, {x, 0, 10}, ColorFunction -> OptionValue["Color"], AspectRatio -> .1, PlotRangePadding -> None, BaseStyle -> {OptionValue["LegendTickFontSize"], FontFamily -> Times}, FrameTicks -> {If[OptionValue["LinearScaling"], LinTicks[ If[OptionValue["AbsoluteScaling"], {0, 0.5 absmax, 1 absmax}, {0, 0.5, 1}], If[OptionValue["AbsoluteScaling"], {0.25 absmax, 0.75 absmax, Null}, {0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, MajorTickLength -> {0.08, 0.03}, MinorTickLength -> {0.08, 0.03}, TickPostTransformation -> If[OptionValue["AbsoluteScaling"], (#1/absmax &), (#1 &)], TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)]], LinTicks[ If[OptionValue["AbsoluteScaling"], {0, 0.2 absmax, 0.4 absmax, 1 absmax}, {0, 0.2, 0.4, 1}], If[OptionValue["AbsoluteScaling"], {0.6 absmax, 0.8 absmax, Null}, {0.6, 0.8, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (ArcSinh[#1*prefactor/absmax]/ ArcSinh[prefactor] &), (ArcSinh[#1*prefactor]/ ArcSinh[prefactor] &)], MajorTickLength -> {0.08, 0.03}, MinorTickLength -> {0.08, 0.03}]], None, None, None}, ImageSize -> OptionValue["LegendHeight"]]]; If[OptionValue["ComplexSignal"], contours = Drop[Table[n, {n, 0., 1., 1./ncontours}], {ncontours/2 + 1}]; implot = If[Chop[Max[Abs[Im[list]]](*/Max[Abs[Re[list]]]*)] == 0, Null, Module[{max, min, max2, max2b, nlist, slist, max3, snlist, cstyle}, {max, min} = {Max[Im[list]], Min[Im[list]]}; max2 = Max[Abs[{max, min}]]; max2b = Max[Abs[{Max[Re[list]], Min[Re[list]]}]]; nlist = Im[list]/max2; slist = If[OptionValue["LinearScaling"], nlist, ArcSinh[prefactor*nlist]]; max3 = Max[Abs[{Max[slist], Min[slist]}]]; If[max2b > max2, max3 = max3 max2b/max2]; snlist = (OptionValue["ScaleFactor"] slist)/(2*max3) + 0.5; cstyle = Module[{c, nc}, c = contours; If[OptionValue["ThickContours"], Transpose[{Table[Thick, {Length[c]}], OptionValue["Color"] /@ c}], OptionValue["Color"] /@ c]]; ListContourPlot[snlist, PlotRange -> {xrange2, yrange2, Full}, Contours -> contours, ColorFunction -> OptionValue["Color"], Evaluate[FilterRules[{plotopts}, Options[ListContourPlot]]], ContourShading -> False, ContourStyle -> cstyle, ImageSize -> {Automatic, OptionValue["ImageHeight"]}, ColorFunctionScaling -> False, AspectRatio -> Automatic, DataRange -> {xrange, yrange}, PlotRangePadding -> None, FrameStyle -> Directive[Thick, Black], FrameTicks -> imticks]]]; replot = If[Chop[Max[Abs[Re[list]]](*/Max[Abs[Im[list]]]*)] == 0, Null, Module[{max, min, max2, max2b, nlist, slist, max3, snlist, cstyle}, {max, min} = {Max[Re[list]], Min[Re[list]]}; max2 = Max[Abs[{max, min}]]; max2b = Max[Abs[{Max[Im[list]], Min[Im[list]]}]]; nlist = Re[list]/max2; slist = If[OptionValue["LinearScaling"], nlist, ArcSinh[prefactor*nlist]]; max3 = Max[Abs[{Max[slist], Min[slist]}]]; If[max2b > max2, max3 = max3 max2b/max2]; snlist = (OptionValue["ScaleFactor"] slist)/(2*max3) + 0.5; cstyle = Module[{c, nc}, c = contours; If[OptionValue["ThickContours"], Transpose[{Table[Thick, {Length[c]}], OptionValue["Color"] /@ c}], OptionValue["Color"] /@ c]]; ListContourPlot[snlist, PlotRange -> {xrange2, yrange2, Full}, Contours -> contours, Evaluate[FilterRules[{plotopts}, Options[ListContourPlot]]], ContourShading -> False, ContourStyle -> cstyle, ImageSize -> {Automatic, OptionValue["ImageHeight"]}, ColorFunctionScaling -> False, ColorFunction -> OptionValue["Color"], AspectRatio -> Automatic, DataRange -> {xrange, yrange}, PlotRangePadding -> None, FrameStyle -> Directive[Thick, Black], FrameTicks -> reticks]]]; reimplotlegend = If[SameQ[OptionValue["LegendOrientation"], "Vertical"], DensityPlot[y, {x, 0, 10}, {y, -1, 1}, ColorFunction -> OptionValue["Color"], AspectRatio -> 10, PlotRangePadding -> None, BaseStyle -> {OptionValue["LegendTickFontSize"], FontFamily -> Times}, FrameTicks -> {None, None, None, If[OptionValue["LinearScaling"], LinTicks[ If[OptionValue[ "AbsoluteScaling"], {-1 reimmax, -0.5 reimmax, Null, 0, 0.5 reimmax, 1 reimmax}, {-1, -0.5, Null, 0, 0.5, 1}], If[OptionValue[ "AbsoluteScaling"], {-0.75 reimmax, -0.25 reimmax, 0.25 reimmax, 0.75 reimmax, Null}, {-0.75, -0.25, 0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, MajorTickLength -> {0.5, 0.1}, MinorTickLength -> {0.5, 0.2}, TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (#1/absmax &), (#1 &)]], LinTicks[ If[OptionValue[ "AbsoluteScaling"], {-1 reimmax, -0.5 reimmax, Null, 0, 0.5 reimmax, 1 reimmax}, {-1, -0.5, Null, 0, 0.5, 1}], If[OptionValue[ "AbsoluteScaling"], {-0.75 reimmax, -0.25 reimmax, 0.25 reimmax, 0.75 reimmax, Null}, {-0.75, -0.25, 0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (ArcSinh[#1*prefactor/reimmax]/ ArcSinh[prefactor] &), (ArcSinh[#1*prefactor]/ ArcSinh[prefactor] &)], MajorTickLength -> {0.5, 0.1}, MinorTickLength -> {0.5, 0.2}]]}, ImageSize -> {Automatic, OptionValue["LegendHeight"]}], DensityPlot[y, {y, -1, 1}, {x, 0, 10}, ColorFunction -> OptionValue["Color"], AspectRatio -> .1, PlotRangePadding -> None, BaseStyle -> {OptionValue["LegendTickFontSize"]}, FrameTicks -> {If[OptionValue["LinearScaling"], LinTicks[ If[OptionValue[ "AbsoluteScaling"], {-1 reimmax, -0.5 reimmax, Null, 0, 0.5 reimmax, 1 reimmax}, {-1, -0.5, Null, 0, 0.5, 1}], If[OptionValue[ "AbsoluteScaling"], {-0.75 reimmax, -0.25 reimmax, 0.25 reimmax, 0.75 reimmax, Null}, {-0.75, -0.25, 0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, MajorTickLength -> {0.08, 0.02}, MinorTickLength -> {0.08, 0.02}, TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (#1/reimmax &), (#1 &)]], LinTicks[ If[OptionValue[ "AbsoluteScaling"], {-1 reimmax, -0.5 reimmax, Null, 0, 0.5 reimmax, 1 reimmax}, {-1, -0.5, Null, 0, 0.5, 1}], If[OptionValue[ "AbsoluteScaling"], {-0.75 reimmax, -0.25 reimmax, 0.25 reimmax, 0.75 reimmax, Null}, {-0.75, -0.25, 0.25, 0.75, Null}], MajorTickStyle -> {Directive[Thick]}, MinorTickStyle -> {Directive[Thick]}, TickLabelFunction -> If[OptionValue[ "AbsoluteScaling"], (sciform[#] &), (NumberForm[#, {2, 1}] &)], TickPostTransformation -> If[OptionValue[ "AbsoluteScaling"], (ArcSinh[#1*prefactor/reimmax]/ ArcSinh[prefactor] &), (ArcSinh[#1*prefactor]/ ArcSinh[prefactor] &)], MajorTickLength -> {0.08, 0.02}, MinorTickLength -> {0.08, 0.02}]], None, None, None}, ImageSize -> OptionValue["LegendHeight"]]]; {absplotlegend, absplot, replot, implot, reimplotlegend}, {absplotlegend, absplot}]];