I want to density plot this function:
concentration2D[x_, y_] :=
rate/(2*Pi*diff)*E^((-(y - 0)*advection)/(2*100))*
BesselK[0,
Norm[{x, y} - {0,0}]/(Sqrt[(100*500)/(
1 + (500)/(4*100))])];
(I have variables in there and I've replaced them with their values to make the answer easier, that's why the calculations are not done)
The problem is that at the point {0,0} this takes an infinite value, which blows the DensityPlot's colorscale out of proportion and I don't get a nice range of colors on my plot. How can I tell Mathematica not to consider that value in its colorscaling?
Thanks to J.M.'s comments, I have this:
DensityPlot[
concentration2D[x, y], {x, -interval, interval}, {y, -interval,
interval}, PlotLegends -> Automatic,
ColorFunction -> (ColorData[{"TemperatureMap", {0, 1}}][#1] &)]
I do get a much nicer range of colors, but there is a big part of the plot that is left white near the discontinuity, as if the color scale doesn't assign any colors to it at all, and playing with the range of the colordata doesn't address it. Any ideas?
DensityPlot[]
. Since $K_0$ is always positive, maybe a coloring scheme that colors all values in $(0,10)$ should suffice, or do you need coloring in a wider range? $\endgroup$ColorData[]
, and remember to setColorFunctionScaling -> False
when you do. FYI:"M10DefaultDensityGradient"
is the default gradient in version 10, if the default is what you want to adjust. $\endgroup$