Guest User

Untitled

a guest
Oct 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. Histogram[RandomVariate[NormalDistribution[10, 2], 500]]
  2.  
  3. Histogram[RandomVariate[NormalDistribution[10, 2], 500],
  4. ColorFunction -> (Which[# < 40, Yellow, 40 <= # < 90, Red, True, Blue] &),
  5. ColorFunctionScaling -> False]
  6.  
  7. cedF[{{xmin_, xmax_}, {ymin_, ymax_}}, ___] :={If[xmax <= 8,
  8. RGBColor[1, 0, 0], Sequence[]],
  9. Dynamic@EdgeForm[Directive[Thickness[.015], Lighter@CurrentValue["Color"]]],
  10. Rectangle[{xmin, ymin}, {xmax, ymax}, RoundingRadius -> 5]};
  11. Histogram[RandomVariate[NormalDistribution[10, 2], 500],ChartStyle -> "Pastel",
  12. ChartElementFunction -> cedF]
  13.  
  14. cedf2[from_,to_,color_: Red, t_:Small, rr_: 0][{{xmin_, xmax_}, {ymin_, ymax_}}, ___] :=
  15. {If[from < xmax <= to, color, Sequence[]],
  16. Dynamic@EdgeForm[Directive[Thickness[t], Lighter@CurrentValue["Color"]]],
  17. Rectangle[{xmin, ymin}, {xmax, ymax}, RoundingRadius -> rr]}
  18.  
  19. Histogram[RandomVariate[NormalDistribution[10, 2], 500], ChartStyle -> "Pastel",
  20. ChartElementFunction -> cedf2[6, 10, Purple, Small, 3]]
  21.  
  22. sgmntsclF = ChartElementDataFunction["SegmentScaleRectangle",
  23. "Segments" -> 8, "ColorScheme" -> "TemperatureMap"];
  24. grdntrctF = ChartElementDataFunction["GradientRectangle",
  25. "ColorScheme" -> "Rainbow", "GradientOrigin" -> Top];
  26.  
  27. Histogram[RandomVariate[NormalDistribution[10, 2], 500], ChartStyle -> "Pastel",
  28. ChartElementFunction -> ((If[7 < #[[1, 2]] <= 10, sgmntsclF[##], grdntrctF[##]]) &)]
  29.  
  30. hist = Histogram[RandomReal[NormalDistribution[10, 2], 500]]
  31.  
  32. Cases[hist, RectangleBox[{a_, _}, {b_, x_}] :> {b, x}, -1];
  33.  
  34. If[# <= 8, Style[#2, Red], #2] & @@@ %;
  35.  
  36. BarChart @ %
  37.  
  38. dat = HistogramList[RandomVariate[NormalDistribution[10, 2], 500]];
  39.  
  40. If[# <= 8, Style[#2, Red], #2] & @@@ Transpose @ dat;
  41.  
  42. BarChart @ %
Add Comment
Please, Sign In to add comment