-1
$\begingroup$

I am interested in plotting histogram, where in each place I would have two columns, the experimental and the theoretical results. Something that looks like:

How can I implement this with Mathematica?

Thank you.

$\endgroup$
  • 1
    $\begingroup$ Have you seen Histogram? BarChart? Have you tried anything? Even it is not straightforward answer we will need a data sample to work with. $\endgroup$ – Kuba May 10 '17 at 21:34
  • $\begingroup$ I didn't see the right option in Histogram. Suppose the data is: {1.0,1.1}, {2.0,2.1},{3.0,3.1}. In each pair here, the left number is the theoretical prediction, and the right number is the experimental result. I want each pair to appear like the picture above. $\endgroup$ – user48750 May 10 '17 at 21:37
  • $\begingroup$ A histogram needs a whole lot more than 3 data points. If you really only have 3 data points, then just presenting the 3 data points better represents the data. $\endgroup$ – JimB May 10 '17 at 21:42
  • $\begingroup$ data = {{1.0, 1.1}, {2.0, 2.1}, {3.0, 3.1}}; BarChart[data, ChartLegends -> {"Predicted", "Actual"}] $\endgroup$ – Bob Hanlon May 10 '17 at 22:20
  • $\begingroup$ related/possible duplicate Q/A: Multiple histograms grouped in a chart $\endgroup$ – kglr Jul 10 '17 at 1:34
2
$\begingroup$
data1 = RandomReal[{0, 10}, 100];
data2 = RandomReal[{0, 10}, 100];
BarChart[{HistogramList[data1][[2]], HistogramList[data2][[2]]},
 ChartStyle -> {Red, Green}]
$\endgroup$
1
$\begingroup$

Not exactly what you asked for but maybe useful:

PairedBarChart[{16.13, 12.9, 3.23, 29.03, 6.45, 25.81, 0, 0, 6.45},
 {9.03, 73.89, 14.14, 2.7, 0.23, 0, 0, 0, 0},
 ChartLabels -> {Placed[{"Experimental", "Theoretical"}, Above], None,
    Placed[{1, 2, 3, 4, 5, 6, 7, 8, 9}, "CenterAxis"]}]

Paired bar chart

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.