I used Show
to combine a ListPlot
and Plot
, and each plot has its own legend. The code is as follows:
list1 =
{{0.1, 0.3}, {0.3, 0.42}, {0.5, 0.48}, {0.7, 0.57}, {0.9, 0.72}};
list2 =
{{0, 0.2}, {0.2, 0.25}, {0.4, 0.31}, {0.6, 0.34}, {0.8, 0.39}};
curve1[x_] := 0.25 + 0.5 x; curve2[x_] := 0.2 + 0.25 x;
p1 = ListPlot[{list1, list2}, PlotRange -> {{0, 1}, {0, 0.8}},
PlotStyle -> {{Red}, {Orange}}, Frame -> True,
PlotLegends -> Placed[PointLegend[{"Experimental data 1",
"Experimental data 2"}], {0.8, 0.3}], ImageSize -> Large];
p2 = Plot[{curve1[x], curve2[x]}, {x, 0, 1},
PlotRange -> {{0, 1}, {0, 0.8}},
PlotStyle -> {Blue, Black}, Frame -> True,
PlotLegends -> Placed[LineLegend[{"Theoretical line for data 1",
"Theoretical line for data 2"}], {0.8, 0.2}], ImageSize -> Large];
Show[p1, p2]
Now I want the four legends to have the same vertical spacing between each other, and the beginning letter "E" and "T" to be exactly aligned in vertical direction. How can I do that?
Comments
Post a Comment