Skip to main content
deleted 15 characters in body; edited tags
Source Link

If I plot an array with option ColorFunction -> "Rainbow" ColorFunction -> "Rainbow":

a = {{0, 1, 5, 3, 0.5, 0, 0, 2, 12, 0.50, 3, 7, 2, 0.2}};
ArrayPlot[a, PlotLegends -> Automatic, ColorFunction -> "Rainbow"]

enter image description herearray plot

but want the points with value = 0 (and only points with value = 0) to appear white (they are missing values) instead of purple, how should I do that? Can I specify a color for discrete points to override what ColorFunction -> "Rainbow"ColorFunction -> "Rainbow" does?

If I plot an array with option ColorFunction -> "Rainbow" :

a = {{0, 1, 5, 3, 0.5, 0, 0, 2, 12, 0.50, 3, 7, 2, 0.2}};
ArrayPlot[a, PlotLegends -> Automatic, ColorFunction -> "Rainbow"]

enter image description here

but want the points with value = 0 (and only points with value = 0) to appear white (they are missing values) instead of purple, how should I do that? Can I specify a color for discrete points to override what ColorFunction -> "Rainbow" does?

If I plot an array with option ColorFunction -> "Rainbow":

a = {{0, 1, 5, 3, 0.5, 0, 0, 2, 12, 0.50, 3, 7, 2, 0.2}};
ArrayPlot[a, PlotLegends -> Automatic, ColorFunction -> "Rainbow"]

array plot

but want the points with value = 0 (and only points with value = 0) to appear white (they are missing values) instead of purple, how should I do that? Can I specify a color for discrete points to override what ColorFunction -> "Rainbow" does?

Tweeted twitter.com/#!/StackMma/status/316865290472398848
Source Link
Sulli
  • 2.2k
  • 15
  • 30

Impose the color for one discrete value above a color predefined gradient

If I plot an array with option ColorFunction -> "Rainbow" :

a = {{0, 1, 5, 3, 0.5, 0, 0, 2, 12, 0.50, 3, 7, 2, 0.2}};
ArrayPlot[a, PlotLegends -> Automatic, ColorFunction -> "Rainbow"]

enter image description here

but want the points with value = 0 (and only points with value = 0) to appear white (they are missing values) instead of purple, how should I do that? Can I specify a color for discrete points to override what ColorFunction -> "Rainbow" does?