6
$\begingroup$

The default ColorFunction of Plot, Plot3D before v10 is respectively mentioned here and here, but I failed to find a related post for that of DensityPlot.

If I knew this, I could use ArrayPlot to imitate DensityPlot more perfectly!:

Row[{DensityPlot[Sin[x y], {x, 0, 3}, {y, 0, 3}, Frame -> None], 
     ArrayPlot[Compile[{}, With[{r = Range[0, 3, 1/40]}, Sin[r #] & /@ r]][], 
               ColorFunction -> "Aquamarine", DataReversed -> True, Frame -> None]}]

enter image description here

$\endgroup$
  • 6
    $\begingroup$ "LakeColors"... $\endgroup$ – Brett Champion Jan 16 '15 at 20:08
  • $\begingroup$ @BrettChampion Oh……I see. You can make this into an answer, anyway it's not that obvious, I think. $\endgroup$ – xzczd Jan 16 '15 at 20:17
  • 1
    $\begingroup$ No, it's not obvious, which is why I gave you a way to find the function without guesswork. $\endgroup$ – Mr.Wizard Jan 16 '15 at 20:18
9
$\begingroup$

Let's find out:

classicDensityPlot = 
  Trace[
    DensityPlot[x y, {x, y} ∈ Disk[], PlotTheme -> "Classic"],
    _Blend &
  ] // Flatten // First // ReleaseHold

ArrayPlot[Compile[{}, With[{r = Range[0, 3, 1/40]}, Sin[r #] & /@ r]][], 
 ColorFunction -> classicDensityPlot, DataReversed -> True, Frame -> None]

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.