Guest User

Untitled

a guest
Nov 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Unprotect[ColorData];
  2. ColorData["myRainbow"] =
  3. Function[x, Blend[{Black, Purple, Blue, Cyan, Green, Yellow, Orange, Red}, x]];
  4. Protect[ColorData]
  5.  
  6. Unprotect[ColorFunction];
  7. ColorFunction["myCF"] = Function[{y}, ColorData["myRainbow"][y]];
  8. Protect[ColorFunction];
  9.  
  10. 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}]);
  11. myplot[y_] :=
  12. ArrayPlot[Table[nd[y, 1, K, n], {K, 1, 50}, {n, 1, 50}],
  13. ColorFunction -> "myCF", ColorFunctionScaling -> False,
  14. DataReversed -> True, Frame -> True, FrameTicks -> Automatic,
  15. FrameLabel -> {Rotate["K", -90 Degree], "N"}]
  16. myplot[5]
Add Comment
Please, Sign In to add comment