1
$\begingroup$

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?

$\endgroup$

1 Answer 1

5
$\begingroup$

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

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.