5
$\begingroup$

The legend box has antialiasing by default. How can it be switched off?

ListLinePlot[Table[f, {f, {Log[x], x^(1/2)}}, {x, 0, 10, 0.1}],
 DataRange -> {0, 10}, Frame -> True,
 PlotLegends -> 
  Placed[LineLegend[{"log(x)", "x^(1/2)"},
    LegendFunction -> (Framed[#, FrameStyle -> (Antialiasing -> False)] &)],
   {{0.5, 0.1}, {0, 0}}]]

enter image description here

enter image description here

By contrast, the old PlotLegends package produces a nice crisp legend frame.

Quiet[<< PlotLegends`];
ListLinePlot[Table[f, {f, {Log[x], x^(1/2)}}, {x, 0, 10, 0.1}],
 DataRange -> {0, 10}, Frame -> True,
 PlotLegend -> Map[Style[#, 12] &, {"log(x)", "x^(1/2)"}],
 LegendSize -> {0.45, 0.3}, LegendPosition -> {0., -0.4},
 LegendShadow -> None, LegendTextSpace -> 2]

enter image description here

$\endgroup$
  • $\begingroup$ I couldn't understand your question at first because on my screen it is very hard to see what you mean. Here's a smaller example that demonstrates the problem better: Magnify[Rasterize[ Graphics[Text[Framed["abcd\nxyzt"]], ImageSize -> 80], "Image"], 5]. Your example also effectively uses Framed inside of an Inset. $\endgroup$ – Szabolcs Feb 8 '17 at 14:25
  • $\begingroup$ Maybe you could export your plot as a PDF file? $\endgroup$ – grbl Feb 8 '17 at 16:04
  • $\begingroup$ What version are you on? It seems to work in v11. $\endgroup$ – M.R. Feb 8 '17 at 20:27
  • $\begingroup$ @M.R. I'm on v11.0.1 on Windows 10. $\endgroup$ – Chris Degnen Feb 9 '17 at 12:13

Your Answer

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

Browse other questions tagged or ask your own question.