3
$\begingroup$

I have the following plot:

Plot1=Plot[Exp[-0.03*t,{t,0,1000}];

Show[Plot1,LineLegend[{Black,Gray,Cyan},{"test1","test2","test3"}]]

Is there a way to add a second legend that only contains markers (say, circles and triangles)?

$\endgroup$
1
  • $\begingroup$ If you uploaded a drawing of what you were seeking, it would be easier to help you. $\endgroup$
    – Nicholas G
    Commented May 22, 2022 at 8:12

2 Answers 2

5
$\begingroup$
Legended[
 Plot[
  Evaluate@Table[Exp[-(0.03)^n*t], {n, 1, 3}],
  {t, 0, 1000},
  PlotLegends -> Automatic],
 Placed[PointLegend[
   ColorData[97] /@ Range[3], {"Marker1", "Marker2", "Marker3"},
   LegendLayout -> "Row",
   LegendMarkers -> (Style[#, 14] & /@ {"\[EmptyCircle]", 
       "\[EmptyUpTriangle]", "\[EmptySquare]"})], Below]]

enter image description here

$\endgroup$
7
$\begingroup$

You can use a list of multiple legends as the option setting for PlotLegends:

Plot[Evaluate @ Table[Exp[-(0.03)^n*t], {n, 1, 3}], {t, 0, 1000}, 
 PlotLegends -> 
  {Placed[{"test 1", "test 2", "test 3"}, Right], 
   Placed[PointLegend[{"Marker 1", "Marker 2", "Marker 3"}, 
     LegendMarkers -> Thread[Style[{"○", "△", "□"}, 14]]], Below]}]

enter image description here

$\endgroup$

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.