3
$\begingroup$

This question already has an answer here:

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$

marked as duplicate by Johu, Henrik Schumacher, eyorble, m_goldberg plotting Sep 1 '18 at 2:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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$ – kglr Aug 28 '18 at 19:32
  • $\begingroup$ Yes, it works and I would accept this as an answer. How do you discover " " options? $\endgroup$ – Johu Aug 28 '18 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$ – kglr Aug 28 '18 at 21:52
  • $\begingroup$ I agree, it is a dublicate. I really did try to search before my question. $\endgroup$ – Johu Aug 29 '18 at 0:00
4
$\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$

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