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$ Commented Feb 18, 2020 at 14:53
  • $\begingroup$ @MichaelE2 I apologize, you're right, I missed two I. $\endgroup$ Commented 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$ Commented 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.sstatic.net/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$ Commented Feb 19, 2020 at 13:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.