I'm trying to put a legend on a plot done using ListPlot

a = Table[i^2, {i, 0, 1, 0.01}];
b = Table[i^3, {i, 0, 1, 0.01}];
ListPlot[{a, b}, PlotLegends -> {"test", "test"}]

I can increase the size of the text in the legend using PlotLegends->Style["legend entry",Fontsize->18] but I can't make the markers in the legend larger, I've tried LegendMarkerSize but the command is not recognized in Mathematica 10 (Student Edition) and I get an unkwown option error.

  • $\begingroup$ does ListPlot[{a, b}, PlotMarkers -> {Automatic, 6}, PlotLegends -> PointLegend[{"test", "test"}, LegendMarkers -> {Automatic, 16}]] work? Change 16 to a different number to play with the size of markers. $\endgroup$
    – kglr
    May 18, 2019 at 12:38
  • $\begingroup$ Thanks, adding the PointLegend worked! $\endgroup$
    – Three Diag
    May 18, 2019 at 13:42

1 Answer 1

ListPlot[{a, b}, PlotMarkers -> {Automatic, Tiny}, 
  PlotLegends ->  PointLegend[{"test", "test"}, LegendMarkers -> {Automatic, 24}]] 

enter image description here

You can also use

 ListPlot[{a, b}, PlotMarkers -> Automatic, 
 PlotLegends -> PointLegend[{"test", "test"}, LegendMarkerSize -> {30, 20}, 
   BaseStyle -> FontSize -> 20]]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.