I made four plots, named Fig1~Fig4. Then I used Grid to put them together in one figure. Now I wish to add a legend in the bottom of the last figure.
Grid[{{Fig1, Fig2}, {Fig3, Fig4}}, Spacings -> {0, 0}]
I made four plots, named Fig1~Fig4. Then I used Grid to put them together in one figure. Now I wish to add a legend in the bottom of the last figure.
Grid[{{Fig1, Fig2}, {Fig3, Fig4}}, Spacings -> {0, 0}]
You can use Legended
(look at documentation to customize for your needs). Dummy data for illustrative purposes:
Legended[Grid[
Partition[
Plot[{##}, {x, -1, 1}, PlotStyle -> {Red, Blue}] & /@ {{1 - x,
x^2}, {2 - x, x^2 - 1}, {x, 1 - x^2}, {x + 1, 2 - x^2}}, 2]],
LineLegend[{Red, Blue}, {"Condition 1", "Condition 2"}]]
Maybe this is helpful:
myR = Range[10, 80, 10];
lp1 = ListPlot[Sqrt[Range[myR[[1]]]], PlotStyle -> Red, PlotMarkers -> "☐"];
lp2 = ListPlot[Sqrt[Range[myR[[2]]]], PlotStyle -> Blue, PlotMarkers -> "⦿"];
lp3 = ListPlot[Sqrt[Range[myR[[3]]]], PlotStyle -> Blue, PlotMarkers -> "⦿"];
lp4 = ListPlot[Sqrt[Range[myR[[4]]]], PlotStyle -> Red, PlotMarkers -> "☐"];
Legended[Grid[{{lp1, lp2}, {lp3, lp4}}], LineLegend[{Blue, Red}, {"⦿", "☐"}]]