I'm using Show
to combine three plots. The code I write is as follows:
g1 = Plot[x^2 + 3, {x, 0, 3},
PlotLegends ->
Placed[LineLegend[{TraditionalForm[k == 1]},
LegendLayout -> "Row",
LegendFunction -> (Framed[#1, FrameMargins -> 0] & )], Below],
AxesOrigin -> {0, 0}, PlotStyle -> Red];
g2 = Plot[x^3 + x, {x, 1, 4},
PlotLegends ->
Placed[LineLegend[{TraditionalForm[k == 2]},
LegendLayout -> "Row",
LegendFunction -> (Framed[#1, FrameMargins -> 0] & )], Below],
AxesOrigin -> {0, 0}, PlotStyle -> Blue];
g3 = Plot[20/x, {x, 1/2, 4},
PlotLegends ->
Placed[LineLegend[{TraditionalForm[k == 3]},
LegendLayout -> "Row",
LegendFunction -> (Framed[#1, FrameMargins -> 0] & )], Below],
AxesOrigin -> {0, 0}, PlotStyle -> Black];
Show[{g1, g2, g3}, PlotRange -> {{0, 4}, {0, All}}]
As we can see in the output, the three legends are seperate in three frames. How can I place the three legends in a row in one frame?