0
$\begingroup$

I am drawing a plot with some legends. It seems the legend markers will always have squares in each line. My question is, is it possible to get rid of those squares through the legend markers? is there another way to do it?

Needs["PlotLegends`"]
A = ( {
    {-5, 0},
    {-4, 1},
    {-3, 1},
    {-2, 0}
   } );

X = ListLinePlot[A, PlotTheme -> "Scientific", 
   PlotStyle -> {Blue, Thickness[0.005], AbsoluteDashing[5]}, 
   PlotLegends -> 
    LineLegend[{"\!\(\*SubscriptBox[OverscriptBox[\(X\), \(~\)], \(11\
\)]\)= (-4,-3,1,1)"}, 
     LegendMarkers -> {Blue, Thickness[0.005], AbsoluteDashing[5]}], 
   AxesLabel -> {"x", "y"}];

Show[X, 
 PlotLabel -> 
  "Negative Fuzzy Solution \!\(\*OverscriptBox[\(X\), \(~\)]\)", 
 PlotRange -> All]```
$\endgroup$
1
  • 1
    $\begingroup$ Remove LegendMarkers, you also need FrameLabel not AxesLabel. $\endgroup$
    – yarchik
    Jun 16, 2020 at 11:19

1 Answer 1

1
$\begingroup$

This seems working:

A = ({{-5, 0}, {-4, 1}, {-3, 1}, {-2, 0}});
X = ListLinePlot[A, PlotTheme -> "Scientific",  PlotStyle -> {Blue, Thickness[0.005], AbsoluteDashing[5]}, 
    PlotLegends -> 
    LineLegend[{"\!\(\*SubscriptBox[OverscriptBox[\(X\), \(~\)], \(11\)]\)= (-4,-3,1,1)"}, Joined -> False, 
     LegendMarkers ->   Graphics[{Blue, Thickness[0.1], Line[{{-4, 0}, {4, 0}}]}], 
    LegendMarkerSize -> {50, 10}], AxesLabel -> {"x", "y"}];

Show[X, PlotLabel -> "Negative Fuzzy Solution \!\(\*OverscriptBox[\(X\), \(~\)]\)", PlotRange -> All]
$\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.