I'm trying to use Legended
to add a legend to a plot that has a black background. I can make the background of the legend to be black as well, but there is a white border around it, which I can't figure out how to remove. How do I remove this white space?
blackFrame[legend_] :=
Framed[legend, FrameStyle -> White, Background -> Black]
Legended[
Plot[x, {x, 0, 1},
ColorFunction -> ColorData["Temperature"],
Axes -> False,
Background -> Black],
BarLegend[
{ColorData["Temperature"], {0, 1}},
LegendFunction -> blackFrame,
LabelStyle -> Directive[White]]]