Simple task: I would like to place two bar charts in a row and have an indicator horizontal line going above the two bar charts.
What I did:
bar1 = BarChart[{100, 75, 100}, ChartLayout -> "Stacked",
ChartStyle -> {Blue, Black, Blue}, Frame -> False, Axes -> False,
PlotLabel -> "bar1"];
bar2 = BarChart[{100, 38, 15, 38, 85}, ChartLayout -> "Stacked",
ChartStyle -> {Blue, Black, White, Black, Blue}, Frame -> False,
Axes -> False, PlotLabel -> "bar2"];
indicator =
Plot[-65 + 100, {x, 0, 4}, PlotStyle -> Red,
PlotLegends -> ToString[65]];
To combine the plots, I tried:
Show[Row[bar1, bar2], indicator]
but the result:
HELP ! The colors need to be the same.
Row
requires the objects to be put in a list in the first argument, like inRow[{obj1, obj2, ...}]
. You miss the curly braces in your code $\endgroup$Overlay[{GraphicsRow[{bar1, bar2}],indicator}]
but I am not sure where exactly you want that line to pass. $\endgroup$