4
$\begingroup$

I am trying to do a DiscretePlot3D with something similar like "TemperatureMap" Color Scheme, where, however, the white color should correspond to ca. 1/3 of the maximum value. Based on the previous question with answers I have written something like this, which, however, does not work. More or less I simply cut the "TemperatureMap" Color Scheme by hand ... Any suggestion, what do I wrong?

clist = DataPaclets`ColorData`GetBlendArgument["TemperatureMap"];
clist

enter image description here

enter image description here

mycolorFunc2 = Blend[myclist, #] &;
DiscretePlot3D[
 SurvivalFunction[
  MultivariatePoissonDistribution[5, {2, 3}], {x, y}], {x, 0, 15}, {y,
   0, 15}, PlotStyle -> Orange, ExtentSize -> Right, 
 ColorFunction -> (ColorData[mycolorFunc2][#3][
     Rescale[#3, {0, 1}]] &), ColorFunctionScaling -> False]
$\endgroup$
3
  • $\begingroup$ Try some simplified version DiscretePlot3D[ SurvivalFunction[ MultivariatePoissonDistribution[5, {2, 3}], {x, y}], {x, 0, 15}, {y, 0, 15}, PlotStyle -> Orange, ExtentSize -> Right, ColorFunction -> (mycolorFunc2[Rescale[#3, {0, 1}]] &), ColorFunctionScaling -> False] $\endgroup$
    – yarchik
    Nov 4, 2021 at 22:51
  • $\begingroup$ It worked, thanks! Don't you want to write it as an answer? $\endgroup$
    – Agnieszka
    Nov 5, 2021 at 7:37
  • $\begingroup$ No, it is a small thing. Nice plot design idea, by the way. $\endgroup$
    – yarchik
    Nov 5, 2021 at 8:07

1 Answer 1

1
$\begingroup$
colorFunc[quantile_: 1/3, colorscheme_: "TemperatureMap"] := 
 ColorData[colorscheme][If[# <= quantile, Rescale[#, {0, quantile}, {0, 1/2}], 
    Rescale[#, {quantile, 1}, {1/2, 1}]]] &

q = 1/3;

DiscretePlot3D[SurvivalFunction[MultivariatePoissonDistribution[5, {2, 3}], {x, y}], 
 {x, 0, 15}, {y, 0, 15}, 
 ExtentSize -> Right, 
 ColorFunction -> (colorFunc[q][#3] &), 
 ColorFunctionScaling -> False, 
 ImageSize -> Large, 
 FaceGrids -> ({#, {{}, {q}}} & /@ {{-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}}), 
 FaceGridsStyle -> Black, 
 Ticks -> {Automatic, Automatic, {0, q, 1}}]

enter image description here

Use q = 2/3 to get

enter image description here

Use ColorFunction -> (colorFunc[q, {"TemperatureMap", "Reversed"}][#3] &) to get

enter image description here

Use ColorFunction -> (colorFunc[q, "RedGreenSplit"][#3] &) to get

enter image description here

etc.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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