Issue
I have a Python code that gives me plot like this one (made by matplotlib):
the mean value is about 0.6065
Then I change a parameter and, starting from a certain value, matplotlib automatically add a string like 1e-6+6.0459e-1
to the vertical axis:
What does it mean?
Maybe that there is a "reference" y-value at +6.0459e-1
and there is an oscillation peak to peak of about 5e-6?
Solution
It means that each number y
on the vertical axis is actually y * 10**-6 + 6.0459 * 10**-1
.
In other words, the sine curve is basically the flat line 6.0459 * 10**-1
(a.k.a. 0.60459
) that has some additive "noise" (the sine curve) of the order of 10**-6
, which is a very small number.
You can force a more legible scale with something like plt.ylim(0.604, 0.605)
.
I think this is documented in the "Offset notation and scientific notation" section of the documentation for matplotlib.ticker.ScalarFormatter
:
Offset notation and scientific notation look quite similar at first sight. Both split some information from the formatted tick values and display it at the end of the axis.
- The scientific notation splits up the order of magnitude, i.e. a multiplicative scaling factor, e.g.
1e6
.- The offset notation separates an additive constant, e.g.
+1e6
. The offset notation label is always prefixed with a+
or-
sign and is thus distinguishable from the order of magnitude label.
Thus, in 1e-6+6.0459e-1
:
1e-6
is the order of magnitude in scientific notation+6.0459e-1
is the offset in scientific notation
Answered By - ForceBru
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.