0

Is there a way I can code the following excel bar chart into Mathematica. Is there any guidebook I can follow? I’m struggling displaying multiple data sets into one figure and filling in the bar with different pattern as such:

enter image description here

Sarah
  • 1
  • 1
  • Welcome to Mathematica.SE! I suggest the following:
    1. As you receive help, try to give it too, by answering questions in your area of expertise.
    2. Take the [tour] and check the faqs!
    3. When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge.

    Also, please remember to accept the answer, if any, that solves your problem, [by clicking the checkmark sign](http://tinyurl.com/4srwe26

    – Dunlop Mar 11 '20 at 05:00
  • Have you checked out the help for BarChart[], there are plenty of examples there that can help you do exactly this? – Dunlop Mar 11 '20 at 05:02
  • https://reference.wolfram.com/language/ref/BarChart.html – Rom38 Mar 11 '20 at 05:49
  • I think one can do better than reproducing charts from Excel. Depending on what aspects you want compared (Series within populations? Populations within series?), you might consider "dot plots". Posts by @NickCox are very useful: https://stats.stackexchange.com/questions/149138/how-to-add-a-third-variable-to-a-bar-plot and https://stats.stackexchange.com/questions/182096/alternative-visualizations-to-3d-bar-chart. – JimB Mar 11 '20 at 19:42
  • Can you provide your data and what you have (probably) tried - so maybe we can help and improve it. – mgamer Mar 11 '20 at 20:36

1 Answers1

3

If you have version 12.1, you can use PatternFilling and HatchFilling in ChartStyle option setting:

SeedRandom[777]
data = RandomReal[10, {5, 3}];

BarChart[data, 
 ChartStyle -> {Directive[Red, HatchFilling[45 Degree, 3, 5]], 
   PatternFilling[{"DiamondBox", Green}, ImageScaled[1/30]], 
   Directive[Blue, HatchFilling[135 Degree, 3, 5]]}, 
 ChartLegends -> {"A", "B", "C"}, 
 LegendAppearance -> {"LegendMarkerSize" -> 30}, ImageSize -> Large]

enter image description here

Note: See also this answer and this answer by Sjoerd C.de Vries

kglr
  • 394,356
  • 18
  • 477
  • 896