4
$\begingroup$

The new function of Mathematica 12, Around, is a replacement of the obsolete ErrorBar function from ErrorBarPlots package. It's a nice function, but I found out that if the center value is imaginary and the error is too small, the default styling showing a plus-minus sign would fail.

For example,

Around[1.500 , 3.*10^-6]

gives $$1.5000000\pm30$$

Around[1.500 I, 3.*10^-5]

gives $$0.000000+1.500000 \,i\pm0.000030$$ but

Around[1.500 I, 3.*10^-6]

gives

Around[0. + 1.5 I, 3.*10^-6]

This certainly won't affect calculation, but it's still a problem. Is there a fix for this?

$\endgroup$
2
  • $\begingroup$ I think you're missing an I or two, yes? $\endgroup$
    – Michael E2
    Feb 18, 2020 at 14:53
  • $\begingroup$ @MichaelE2 I apologize, you're right, I missed two I. $\endgroup$
    – Turgon
    Feb 19, 2020 at 7:21

1 Answer 1

4
$\begingroup$

I think it might be a bug, but there's a threshold you can use as a workaround:

Language`UncertaintyDump`$redThreshold
(*  0.00001  *)

The threshold must be set at the time the boxes are created.

Temporary setting means creating the cell programmatically:

Block[{Language`UncertaintyDump`$redThreshold = 10^-8},
 CellPrint[ExpressionCell[Around[1.500 I, 3.*10^-6], "Output"]]
 ]

Mathematica graphics

Use a persistent setting and normal output will use the new value:

Language`UncertaintyDump`$redThreshold = 10.^-6;
Around[1.500 I, 3.*10^-6]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Is there any side effect changing this threshold value might bring? $\endgroup$
    – Turgon
    Feb 19, 2020 at 7:23
  • $\begingroup$ @Turgon It will change when Around is displayed in the "AroundSeq" style instead of the "Around" style. Examples. i.stack.imgur.com/gxX25.png . Aside from that I don't know. It seems unlikely that a threshold would be used for two purposes. In the use here, it switches between the internal functions redpmStructure[] and pmStructure[], which create the two formatted output styles. But as it is undocumented, I cannot be sure it does not have other side effects. (To me it seems unlikely that it does, FWIW.) $\endgroup$
    – Michael E2
    Feb 19, 2020 at 13:12

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.