3
$\begingroup$

The Legends(dashing) in the following plot appear dull. I want to make those dashes in the Legends slightly bold.

 P1 = Plot[{Sin[ t], Cos[ t], Tan[ t]}, {t, 0, 10}, 
  PlotStyle -> {{Blue, Dashing[None], Thickness[0.005]}, {Red, 
     Dashing[Tiny], Thickness[0.005]}, {Green, Dashing[Small], 
     Thickness[0.005]}}, Axes -> False, Frame -> True, 
  PlotLegends -> 
   Placed[LineLegend[Automatic, {"sin", "cos", "tan for b=1"}, 
     LegendMarkerSize -> {{20, 10}}], Top]]
$\endgroup$
4
$\begingroup$

This is not the most elegant solution, but if I have understood your question correctly, does the job.

legend = With[{t = 0.02},
   LineLegend[{
     Directive[Blue, Dashing[None], Thickness[t]],
     Directive[Red, Dashing[Tiny], Thickness[t]], 
     Directive[Green, Dashing[Small], Thickness[t]]},
    {"sin", "cos", "tan for b=1"},
    LegendMarkerSize -> {{40, 10}}
    ]
   ];

Plot[
 {Sin[t], Cos[t], Tan[t]}, {t, 0, 10},
 PlotStyle -> {
   {Blue, Dashing[None], Thickness[0.005]},
   {Red, Dashing[Tiny], Thickness[0.005]},
   {Green, Dashing[Small], Thickness[0.005]}
   },
 Axes -> False, Frame -> True, PlotLegends -> Placed[legend, Top]
 ]

plot

$\endgroup$
2
$\begingroup$

Using a slightly modified version of this answer,

ClearAll[makeThick, postProcess]
makeThick[t_: 3] := RawBoxes[Replace[ToBoxes@#, 
     LineBox[x_] :> {AbsoluteThickness[t], CapForm["Butt"], LineBox[x]}, Infinity]] &;

postProcess[t_: 3] := # /. leg_LineLegend :> (makeThick[t][leg]) &;

postProcess[] @ P1

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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