# Density plot for data with a wide dynamic range

I'm generating some figures for a paper. One of them has a pattern like the following figure:

DensityPlot[
Abs[Exp[-Sqrt[x^2 + y^2]/5] BesselJ[0, Sqrt[x^2 + y^2]]], {x, -20,
20}, {y, -20, 20}, ColorFunction -> "SunsetColors",
PlotPoints -> 100, PlotRange -> All, PlotRangePadding -> 0,
FrameTicksStyle ->
Directive[FontFamily -> "Arial", 12, Plain, Thick],
ImageSize -> {Automatic, 150}] Since the magnitude in the middle could be much higher than that in the outer region, some rings cannot be seen if I print it. In addition, since the pattern represents magnitude, I prefer a kind of "hot" color map to render these data. How can I solve the problem such that the pattern can be seen clearly on a printed copy?

• "large data"--I think it may be better to say "wide dynamic range" or something like that; what do you think? – acl Apr 2 '13 at 16:08
• yes, you are right. I should say clearly. sorry about that. – Tony Dong Apr 2 '13 at 16:33

ColorFunction takes an actual function as input. Thus, eg,

Manipulate[
DensityPlot[
Abs[Exp[-Sqrt[x^2 + y^2]/5] BesselJ[0, Sqrt[x^2 + y^2]]], {x, -20,
20}, {y, -20, 20},
ColorFunction -> Function[{f}, RGBColor[#, #, #] &@(f^alpha)],
PlotPoints -> 100, PlotRange -> All, PlotRangePadding -> 0,
FrameTicksStyle ->
Directive[FontFamily -> "Arial", 12, Plain, Thick],
ImageSize -> {Automatic, 150}],
{{alpha, .2}, 0.01, 2}
] or with SunsetColors:

Manipulate[
DensityPlot[
Abs[Exp[-Sqrt[x^2 + y^2]/5] BesselJ[0, Sqrt[x^2 + y^2]]], {x, -20,
20}, {y, -20, 20},
ColorFunction -> (ColorData["SunsetColors"][#^alpha] &),
PlotPoints -> 100, PlotRange -> All, PlotRangePadding -> 0,
FrameTicksStyle ->
Directive[FontFamily -> "Arial", 12, Plain, Thick],
ImageSize -> {Automatic, 150}],
{{alpha, .2}, 0.01, 2}
] Two possibilities:

DensityPlot[Abs[Exp[-Sqrt[x^2 + y^2]/5] BesselJ[0, Sqrt[x^2 + y^2]]]^(
1/4), {x, -20, 20}, {y, -20, 20},
ColorFunction -> "SunsetColors",
PlotPoints -> 100, PlotRange -> All, PlotRangePadding -> 0,
FrameTicksStyle ->
Directive[FontFamily -> "Arial", 12, Plain, Thick],
ImageSize -> {Automatic, 150}] DensityPlot[
20 Abs[Exp[-Sqrt[x^2 + y^2]/5] BesselJ[0, Sqrt[x^2 + y^2]]], {x, -20,
20}, {y, -20, 20},
ColorFunction -> "SunsetColors",
ColorFunctionScaling -> False,
PlotPoints -> 100, PlotRange -> All, PlotRangePadding -> 0,
FrameTicksStyle ->
Directive[FontFamily -> "Arial", 12, Plain, Thick],
ImageSize -> {Automatic, 150}] In the first attempt, I raised the small values by taking the fourth root of the Abs. In the second version, I turned off ColorFunctionScaling and multiplied by 20 to raise the small values. In that case, the hight values are cut off.

You can replace the power 1/4 in the first version by 1/2 to darken the lower values.