3
$\begingroup$

I want to customize the frame and ticks of the BarLegend, but according to the documentation it does not support standard Graphics options. Perhaps there is a hack possible?

More specifically I want the frame and ticks to be with a fixed AbsoluteThickness and Black.

When testing, I figured out that although in conflict with documentation

BarLegend[{"SolarColors", {0, 1}}, 5, FrameStyle -> Directive[Red, Thick], TicksStyle -> Directive[Red, Thick]] 

enter image description here

does actually change the colour and thickness of the frame, but not the thickness of the tick. How to also change the thickness of the tick?

$\endgroup$
4
  • 1
    $\begingroup$ does BarLegend[{"SolarColors", {0, 1}}, 5 , "TicksStyle" -> Directive[ Red, FontColor->Black, AbsoluteThickness[5]], "FrameStyle" -> Directive[Red, Thick]] work in your version /OS? $\endgroup$ Commented Aug 28, 2018 at 19:32
  • $\begingroup$ Yes, it works and I would accept this as an answer. How do you discover " " options? $\endgroup$ Commented Aug 28, 2018 at 19:43
  • 2
    $\begingroup$ Johu, as I was searching where else I used "TicksStyle" i found How can I change the thickness of tick marks in BarLegend? which looks like a duplicate/ almost duplicate. It probably was during one of those spelunking expeditions where I bumped into Charting`iBarLegend and Options[Charting`iBarLegend] . $\endgroup$ Commented Aug 28, 2018 at 21:52
  • $\begingroup$ I agree, it is a dublicate. I really did try to search before my question. $\endgroup$ Commented Aug 29, 2018 at 0:00

1 Answer 1

5
$\begingroup$
BarLegend[{"SolarColors", {0, 1}}, 5, "TicksStyle" -> Directive[ Red, FontColor -> Black, AbsoluteThickness[5]], "FrameStyle" -> Directive[Red, Thick]] 

enter image description here

This works in version 9 / Windows 10 and version 11.3 / Wolfram Cloud.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.