What are these markers at the bottom of BarLegend?

Bug introduced in 11.3 and fixed in 12.0

I've noticed these small ruler-type markers at the bottom of BarLegend objects.

BarLegend["Rainbow"]


(Enhance!)

I don't remember seeing them in previous answers and they only appear in the documentation when I reevaluate objects. I don't see any reference to it in the documentation to manipulate or hide them either (I've tried Ticks->None to no effect). Any ideas how to remove them?

This is on Mathematica 11.3 on Linux.

• They are not there in 11.3 on Windows 8.1. – Johu Sep 4 '18 at 17:50
• Also absent on my Windows 10 PC... – Musang Sep 4 '18 at 19:50
• I've sent a bug report to Wolfram and they've reproduced and acknowledged the issue. I'll update this question if I further information comes around. – Musang Sep 6 '18 at 9:00

I get the same issue in version 11.3 (Wolfram Cloud):

\$Version


"11.3.0 for Linux x86 (64-bit) (March 7, 2018)"

bl = BarLegend["Rainbow", LegendMarkerSize -> {100, 300}]


ImageResize[ImageCrop[Rasterize[bl, RasterSize -> 200], {Full, 100}, Top], 500]


This is caused by the option FrameTicks -> {{False, False}, {True, False}} (that gets in there somewhere along the way):

Cases[ToBoxes[bl], p : Rule[FrameTicks, _], Infinity]


{FrameTicks -> {{False, False}, {True, False}}}

A work-around: post-process the box expression to modify FrameTicks option value:

RawBoxes @ Replace[ToBoxes[bl], Rule[FrameTicks, _] :> Rule[FrameTicks, False], ∞]


Alternatively, change the setting for FrameTicksStyle to White:

RawBoxes@Replace[ToBoxes[bl], Rule[FrameTicksStyle, _]:> Rule[FrameTicksStyle, White], ∞]


same picture

kglr's answer shows a more comprehensive analysis of what is going on. However, if the goal is to export your graphic, there's a simple, but limited workaround. Testing shows that using Export on a rasterized format will display the artefact ticks but NOT if the export is in vector graphics format.

Compare

Export["rasterbar.png",BarLegend["Rainbow"]]


and

Export["vectorbar.svg",BarLegend["Rainbow"]]


(*.pdf also works)