Guest User

Untitled

a guest
Nov 15th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. dat = <|0 -> <|2007 -> 7, 2008 -> 8, 2009 -> 9, 2010 -> 10|>,
  2. 1 -> <|2007 -> 5, 2008 -> 6, 2009 -> 7, 2010 -> 8|>|>;
  3.  
  4. BarChart[dat,
  5. ChartLabels -> {Automatic, None},
  6. ChartLayout -> "Stacked",
  7. ChartLegends -> Automatic,
  8. ColorFunction -> ColorData["DeepSeaColors"]]
  9.  
  10. Unprotect[ColorData];
  11. ColorData["x"] = ColorData[{"DeepSeaColors", "Reverse"}];
  12.  
  13. BarChart[dat, ChartLabels -> {Automatic, None},
  14. ChartLayout -> "Stacked", ChartLegends -> Automatic,
  15. ChartStyle -> "x"]
  16.  
  17. colors = ColorData[{"DeepSeaColors", "Reverse"}] /@ Subdivide[3];
  18. BarChart[dat, ChartLabels -> {Automatic, None},
  19. ChartLayout -> "Stacked", ChartLegends -> Automatic,
  20. ChartStyle -> colors]
  21.  
  22. Legended[
  23.  
  24. PieChart[{mix, males, females},
  25. ColorFunction -> (Switch[#, mix, LightGreen, males, LightBlue,
  26. females, LightPink] &),
  27. ColorFunctionScaling -> False
  28. (*,ChartLegends[Rule]{"mixed gender","male gender",
  29. "female gender"} BUG*)
  30. ]
  31. ,
  32. [{LightGreen, LightBlue, LightPink},
  33. {"Mix", "Male", "Female"}
  34. ]
  35. ]
Add Comment
Please, Sign In to add comment