Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

ListLinePlot generates the same legend for different lists of data when PlotMarkers and PlotStyle options are used:

list = {{{1, 2}, {2, 3}, {3, 4}}, {{2, 4}, {4, 6}, {6, 8}}};
ListLinePlot[list, PlotStyle -> Black, PlotMarkers -> {Automatic, 16}, 
PlotLegends -> {"A", "B"}]

enter image description here

Is this a bug?

I have Mathematica v10.0.0 installed on Windows 8 x64.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You just have to specify the LegendMarkers accordingly:

list = {{{1, 2}, {2, 3}, {3, 4}}, {{2, 4}, {4, 6}, {6, 8}}};
ListLinePlot[list, PlotStyle -> Black, PlotMarkers -> {Automatic, 16},
 PlotLegends -> PointLegend[{"A", "B"}, LegendMarkers -> {Automatic, 16}]]

Plot

share|improve this answer

Another possibility is that you define your own markers:

markers = {Graphics[{Black, Disk[]}], Graphics[{Black, Rectangle[]}]};

list = {{{1, 2}, {2, 3}, {3, 4}}, {{2, 4}, {4, 6}, {6, 8}}};

ListPlot[list,
 PlotLegends -> SwatchLegend[{"A", "B"},
   LegendMarkers -> markers,
   LegendLabel -> "Series",
   LegendFunction -> (Framed[#, RoundingRadius -> 5] &),
   LegendMargins -> 5],
 Joined -> True,
 PlotStyle -> Black,
 PlotMarkers -> Table[{size, 0.05}, {size, markers}]]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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