1
$\begingroup$

I think this will be easy for many of you, but I struggle.

How can I make the label to be n.nn and not this hugely long numbers? See the screenshot.

enter image description here

$\endgroup$
1
  • $\begingroup$ Ordinarily you should post your code as text rather than as an image. $\endgroup$
    – Alan
    Jun 15 at 13:41
2
$\begingroup$

Use NumberForm:

LabelingFunction -> (Placed[NumberForm[Last@#1, 2], Above] &)
$\endgroup$
2
  • 2
    $\begingroup$ You might want {2,2} instead of 2 otherwise the very small numbers in the tail will get a bit long and crowded too. $\endgroup$
    – flinty
    Jun 15 at 13:42
  • $\begingroup$ @flinty True, but then you'll see 0.00 multiple times in the tail. (Of course, labeling small numbers could be suppressed altogether.) $\endgroup$
    – Alan
    Jun 15 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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