I want to have these 3 plots together vertically
P1 = Plot[{0, If[Sin[x π] >= 0, 1000]}, {x, 0, 50}, PlotStyle -> {Directive[White, CapForm["Butt"], Opacity[-1], Thickness[0]], Directive[Red, CapForm["Butt"], Opacity[1000], Thickness[.04]]}, PlotPoints -> 50, MaxRecursion -> 6, AspectRatio -> 1/40, Axes -> {True, False}, Ticks -> {{0, 50}, {0, 0}}] P2 = Plot[{0, If[Cos[x π] >= 0, 1000]}, {x, 50, 100}, PlotStyle -> {Directive[White, CapForm["Butt"], Opacity[-1], Thickness[0]], Directive[Blue, CapForm["Butt"], Opacity[1000], Thickness[.04]]}, AspectRatio -> 1/40, Axes -> {True, False}, Ticks -> {{50, 100}, {0, 0}}] P3 = Plot[{0, If[Sin[x π] < 0, 1000]}, {x, 100, 150}, PlotStyle -> {Directive[White, CapForm["Butt"], Opacity[-1], Thickness[0]], Directive[Green, CapForm["Butt"], Opacity[1000], Thickness[.04]]}, AspectRatio -> 1/40, Axes -> {True, False}, Ticks -> {{100, 150}, {0, 0}}] I use this code
Legended[GraphicsGrid[{{P1}, {P2}, {P3}}], Placed[LineLegend[{Red, Blue, Green}, {Style["a", 10], Style["b", 10], Style["c", 10]}, LegendLayout -> "Row"], Below]] and I expect the result to be like
But what I see is
How can I save the result of this code as the first picture?





ItemAspectRatio->1/10to your GraphicsGrid it seems to work out. $\endgroup$