I use ListPlot
in order to plot four sets of data and also insert legends in my plot. Here is the Mathematica code
data1 = {{0, 48}, {50, 59}, {100, 69}, {150, 78}, {200, 86}, {250,
87}, {300, 88}, {350, 88.5}, {400, 89}, {450, 89.5}, {500, 90}};
data2 = {{0, 50}, {21, 57}, {45, 65}, {69, 73}, {100, 82}, {150,
86}, {200, 90}, {250, 90.5}, {300, 91}, {350, 92}, {400,
93}, {450, 93.5}, {500, 94}};
data3 = {{0, 55}, {50, 60}, {100, 65}, {150, 72}, {200, 80}, {250,
84}, {300, 87}, {350, 89}, {400, 91}, {450, 91.5}, {500, 92}};
data4 = {{0, 63}, {50, 66}, {100, 69}, {150, 72}, {200, 74.5}, {250,
77}, {300, 79}, {350, 81}, {400, 83}, {450, 85}, {500, 87}};
col = {Blue, Darker[Green], Red, Magenta};
leg = {"\!\(\*SubscriptBox[\(L\), \(z\)]\) = 5",
"\!\(\*SubscriptBox[\(L\), \(z\)]\) = 20",
"\!\(\*SubscriptBox[\(L\), \(z\)]\) = 40",
"\!\(\*SubscriptBox[\(L\), \(z\)]\) = 60"};
plrange = {45, 100};
P0 = ListPlot[{data1, data2, data3, data4}, Frame -> True,
PlotStyle -> Table[{Thickness[0.003], col[[i]]}, {i, 1, 4}],
Joined -> True, PlotMarkers -> {Automatic, 12},
FrameLabel -> {Subscript["M", "n"],
"Percentage of chaotic orbits (%)"},
FrameStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"],
PlotRange -> plrange, Axes -> False, ImageSize -> 600,
PlotLegends ->
LineLegend[leg, LegendMarkers -> Automatic,
LegendMarkerSize -> {{20, 25}},
LabelStyle ->
Directive[FontSize -> 15, FontFamily -> "Helvetica"]]]
which produces the following output using version 9
My main issue is how to increase the size of the plot markers in the legend. Inside the main plot, I can control the size of the markers by PlotMarkers -> {Automatic, 12}
. On the other hand, even though I tried a lot, I cannot do the same regarding the markers in the legend. Any ideas?
Update 2015-07-22: In versions 10.x, the above input does create legend markers that are the same size as in the plot itself. But if we specify custom plot makers, we will quickly discover that the legend markers will be inconsistently sized.
ListPlot[
Table[Accumulate@RandomReal[1, 10] + i, {i, 2}],
PlotMarkers -> {
Graphics[{Disk[]}, ImageSize -> 7],
Graphics[{Rectangle[]}, ImageSize -> 13]
},
Joined -> True,
PlotLegends -> {"line1", "line2"}
]
So the fundamental issue remains.
LegendMarkers
. $\endgroup$PlotLegends
. How could I do this? Any clue? $\endgroup$