Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apparently, BarLegend in version 10 displays tick legends in scientific notation when they are smaller in magnitude than 0.01. For instance,

BarLegend[{"Rainbow", {-.015, .015}}, 
LabelStyle -> Directive[Black, Bold, FontSize -> 12]]

creates the object

enter image description here

How can I change the tick labels to decimal notation, as they would have appeared in version 9?

By the way, the Bold directive evidently is being ignored. Is there a work-around for this?

share|improve this question
Just had a look at examples in the docs and LabelStyle looks very buggy. You shouldn't need to explicitly use FontSize, the number should be sufficient -- but it is not. As you say Bold is not recognised, nor is FontWeight->Bold. – Mike Honeychurch Jul 17 '14 at 22:28
Seems to work OK in 10.0.1 – Sjoerd C. de Vries Sep 17 '14 at 13:51
@Sjoerd Confirmed. – Mr.Wizard Sep 17 '14 at 14:05
up vote 12 down vote accepted

Two work-arounds:

(1) Use TickLabels

BarLegend[{"Rainbow", {-0.015, 0.015}}, ImageSize->300,
  Charting`TickLabels -> 
  (Style[NumberForm[#, {Infinity, 3}],Bold,Black,12] & /@ Range[-.015, .015, .005])]

enter image description here

(2) Use LabelingFunction:

BarLegend[{"Rainbow", {-0.015, 0.015}}, ImageSize->300, 
    LabelingFunction -> (Style[NumberForm[#, {Infinity,3}],Bold, Black,12] &)]
(* same picture *)

Note: Just to make the labels Bold the option combination BaseStyle->Directive[Bold,12], LabelStyle->Black also works.

share|improve this answer
Despite the fact that Mathematica flags ImageSize, BaseStyle, LabelingFunction, and Charting`TickLabels as unknown option names, both of your recommendations work well. Thanks, @kguler. – bbgodfrey Jul 18 '14 at 14:17
@bbgodfrey, thank you for the accept. – kglr Jul 18 '14 at 22:29
Version 10.0.1 appears to resolve the issues described above. – bbgodfrey Nov 16 '14 at 18:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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