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.

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
add comment

1 Answer 1

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
add comment

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.