# Set transparency of the legend background in a plot

It is known that the instruction LegendFunction can be used to set the background color of the legend in a Plot or ListPlot, e.g.,

ListPlot[Range[0, 10], Joined -> True,
PlotLegends ->
Placed[PointLegend[{"Title"}, LegendFunction -> (Framed[#, Background -> White] &)], {Right, Top}]
]


However, I haven't found a way to set the transparency (or opacity) of the background. If I don't specify any background color, then the legend is overlapped by the plots; if I set it to, say, white as in the example above, then the legend covers the curves I'm plotting. Is there anything in between?

• Change the background to Background -> Opacity[0, White] However, presumably the location of the legend was chosen to demonstrate whether the background was transparent rather than the final desired location. Jul 31 at 16:02
• Yeah sure, in this example I could have simply moved the legend elsewhere, but in other cases it wouldn't help, as I have curves everywhere in the plot. Anyway it works, thanks! Jul 31 at 16:24

I suggest using Transparent directly as the most idiomatic short alternative, but you can also use Opacity as suggested by @BobHanlon in the comments.

ListPlot[
Range[0, 10]
, Joined -> True
, PlotTheme->"Scientific"
, PlotLegends -> Placed[
PointLegend[
{"Title"}
, LegendFunction -> (Framed[#, Background -> Transparent] &)
]
, {Right, Top}
]
]