Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written the code below:

ListPlot[das1, PlotMarkers -> {\[FilledCircle], 12}, 
 PlotStyle -> {Black}, Joined -> True, Mesh -> All, MeshStyle -> Red, 
 PlotLegends -> 
 Placed[Style[#, FontSize -> 20] & /@ {"6.7 ps"}, {Top, Right}]]

I want a black line to go through my red data points. Then, I want the plot legend to be red.

However, by using the above code I get a black plot legend.

enter image description here

How can I set the plot legend color independent of the plot itself?

How can I extend the solution to multiple graphs in one plot?

share|improve this question
up vote 5 down vote accepted

One way would be by using PointLegend:

ListPlot[Range[10], PlotMarkers -> {\[FilledCircle]}, 
 PlotLegends -> 
  Placed[PointLegend[{Red, Green}, 
    Style[#, FontSize -> 20] & /@ {"A", "B"}], {Top, Right}], 
 PlotStyle -> {Black}, Joined -> True, Mesh -> All, MeshStyle -> Red]

enter image description here

share|improve this answer

Your Answer


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.