2
$\begingroup$

My BarLegend has a weird line appearing in it. Why??

BarLegend[{GrayLevel, {0, 1}}]

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

After reviewing my code, I realised that setting Mesh options for ArrayPlot can affect BarLegend in unforeseen ways. The code below produces the "weird" line:

SetOptions[ArrayPlot, Mesh -> {All, None}];
BarLegend[{GrayLevel, {0, 1}}]

Whereas removing the Mesh fixes the problem.

SetOptions[ArrayPlot, Mesh -> None];
BarLegend[{GrayLevel, {0, 1}}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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