Bug introduced in 11.3 or earlier and persisting through 12.0.0 or later
While looking at https://mathematica.stackexchange.com/questions/192081/how-do-i-plot-a-divergence, I thought to suggest the following as a solution to the OP's problem (where potdistr
is an InterpolatingFunction
solution to a PDE returned by NDSolve
):
VectorDensityPlot[
Evaluate[Grad[potdistr[x, y], {x, y}]],
{x, -0.01, 0.11}, {y, -0.005, 0.053}]
I surprised that it worked once and then failed on subsequent calls. It seems to be connected to InterpolatingFunction
and values being set for x
and y
. Here is a minimal example:
field = {Interpolation[Range[4]^2/4][y], x};
VectorDensityPlot[field, {x, 1, 4}, {y, 1, 4}]
Subsequent calls generate a InterpolatingFunction::dmval
extrapolation warning message and the vector field is constant.
The problem does not occur if field = {y^2/4, x}
is used. It does not occur for VectorPlot
, DensityPlot
, ContourPlot
, or Plot3D
.
What's going on? Is it a bug? Is there a way to get it to work?
Additional info:
$Version
(* "11.3.0 for Mac OS X x86 (64-bit) (January 22, 2018)" *)
Filed as [CASE:4228039], confirmed by WRI.