Quantcast
Channel: How to force LineLegend to be independent from the plot - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 3

How to force LineLegend to be independent from the plot

$
0
0

I want to design the plot legends independent of the plot style I use in ListLinePlot. So I do:

colors = ColorData[97, "ColorList"];fontsize = 20;    leg = LineLegend[{colors[[5]], {Black, Dotted}}, {Style["simulation",         FontFamily -> Times, fontsize, SingleLetterItalics -> False],        Style["experiment", FontFamily -> Times, fontsize,         SingleLetterItalics -> False]}, Spacings -> {0.4, 0.08},       LegendLayout -> {"Column", 1}, LegendMarkerSize -> {22, 10},       LegendFunction -> (Framed[#,           FrameStyle -> Directive[Black, Thickness[0.5]],           RoundingRadius -> 5, Background -> White,           FrameMargins -> -1] &)]

This shows exactly what I am looking for but when I set the option Joined as False for a list in the ListLinePlot, the LineLegend changes automatically and insert a marker. Here is my setting for ListLinePlot:

plotbend =  ListLinePlot[{Range[0, 10], Range[0, 10]},   PlotStyle -> {colors[[5]], {Dotted, Black}}, Frame -> True,   AspectRatio -> 1.1, Joined -> {True, False}, PlotMarkers -> None,   BaseStyle -> {FontFamily -> Times, FontSize -> fontsize},   FrameStyle -> Black,   FrameLabel -> {Style["Normalized curvature, \!\(\*FractionBox[\(\[Kappa]\), \SubscriptBox[\(\[Kappa]\), \(0\)]]\)", FontFamily -> Times,      FontSize -> fontsize],     Style["Normalized bending moment, \!\(\*FractionBox[\(M\), \SubscriptBox[\(M\), \(0\)]]\)", FontFamily -> Times,      FontSize -> fontsize]}, ImageSize -> 360,   PlotLegends -> Placed[leg, {0.73, 0.14}]]

Is it possible to make the LineLegend totally independent?

I am using Windows 10 and Mathematica 13.0.1.0.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images