0
$\begingroup$

Sorry, lots of code here, somebody explain this to me:

MyRainbow[z_] := Blend[{Black, Purple, Blue, Green, Yellow, Red}, z];
MyRainbow[_, _, z_] := MyRainbow[z];
nd[y_, a_, b_, 
   n_] := (Binomial[b - a + 1, y]*
    Sum[((-1)^i)*Binomial[y, i]*((y - i)/(b - a + 1))^n, {i, 0, y}]);
sbbsth[h_, a_, b_, n_] := 
  Sum[nd[y, a, b, n], {y, 2^h, 
    Min[2^(h + 1) - 1, Min[n, b - a + 1]]}];
ArrayPlot[
 N@ParallelTable[sbbsth[7, 1, K, n], {K, 1, 100}, {n, 1, 100}], 
 ColorFunction -> MyRainbow, DataReversed -> True]

enter image description here

VERSUS (the only change is the color black to orange):

MyRainbow[z_] := Blend[{Orange, Purple, Blue, Green, Yellow, Red}, z];
MyRainbow[_, _, z_] := MyRainbow[z];
nd[y_, a_, b_, 
   n_] := (Binomial[b - a + 1, y]*
    Sum[((-1)^i)*Binomial[y, i]*((y - i)/(b - a + 1))^n, {i, 0, y}]);
sbbsth[h_, a_, b_, n_] := 
  Sum[nd[y, a, b, n], {y, 2^h, 
    Min[2^(h + 1) - 1, Min[n, b - a + 1]]}];
ArrayPlot[
 N@ParallelTable[sbbsth[7, 1, K, n], {K, 1, 100}, {n, 1, 100}], 
 ColorFunction -> MyRainbow, DataReversed -> True]

enter image description here

Why? Just why? Does Mathematica not recognize what the color black is? Hello? I just don't understand why it's doing this. Yes, I have some pretty nasty functions that I'm expecting it to plot, but still, I just don't get the inconsistency. It works for literally any color other than black. Obviously there are easy workaround to this, like choosing another color that's really close to black, but seriously, what's going on here? What is this black magic? I'm on Mathematica 10.3 by the way, in case that makes a difference and this is a bug.

$\endgroup$
  • $\begingroup$ Probably something (singularity with 0?) related to Blend. $\endgroup$ – user202729 Dec 9 '17 at 9:25
  • $\begingroup$ Testing your code on Wolfram sandbox gives black, so it's probably a bug. Fixed in version 11. $\endgroup$ – user202729 Dec 9 '17 at 9:42
  • $\begingroup$ I have tested your code on ver. 11.2 and it gives black too... $\endgroup$ – José Antonio Díaz Navas Dec 9 '17 at 10:35
  • $\begingroup$ Okay, it must be a bug on 10.3. A bit frustrating, but oh well, Thanks for trying it out everyone! $\endgroup$ – ereHsaWyhsipS Dec 9 '17 at 10:42

Your Answer

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

Browse other questions tagged or ask your own question.