6
$\begingroup$

In PointLegend we have (checked with versions 10.4.1 and 11.0.0) EdgeForm[Opacity[0.3]] by default applied to LegendMarkers:

PointLegend[{Directive[Blue, EdgeForm[{Red, Thickness[.05]}]]}, {"label1"}, 
 LegendMarkers -> {Graphics[Disk[]]}, LegendMarkerSize -> 70]

Cases[ToBoxes[%], GraphicsBox[p_, _] /; ! FreeQ[p, DiskBox], Infinity]

RawBoxes@%

legend

GraphicsBox[DiskBox[{0, 0}], {DefaultBaseStyle -> {"Graphics", {AbsolutePointSize[6]}, 
    Directive[PointSize[0.5], AbsoluteThickness[1.6], RGBColor[0, 0, 1], 
     EdgeForm[Directive[Opacity[0.3], RGBColor[1, 0, 0], Thickness[0.257143]]]]}}]

image

As one can see from the above, the edge of the disk has Opacity[0.3] which was not specified in the original PointLegend expression but is somehow introduced during conversion into boxes.

I have two questions:

  1. From where comes Opacity[0.3]?
  2. How to disable it?

I know that one workaround is to put EdgeForm[Opacity[1]] directly into every of the LegendMarkers:

LegendMarkers -> {Graphics[{EdgeForm[Opacity[1]], Disk[]}]}

but I would like to disable this "feature" completely.

$\endgroup$
  • $\begingroup$ No Opacity in version 9. Either a bug or a bad default design decision. Probably an untested special case. $\endgroup$ – Karsten 7. Feb 14 '17 at 4:24
5
$\begingroup$

The opacity comes from this symbol:

Legending`LegendDump`$DefaultMarkerStyle

(* EdgeForm[Directive[Opacity[0.3], GrayLevel[0]]] *)

You can redefine it, e.g.

Legending`LegendDump`$DefaultMarkerStyle = EdgeForm[Black]
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.