Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb56caa

Browse files
committed
Small comment fixups from review
1 parent 6812e77 commit eb56caa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

galleries/examples/ticks/engformatter_offset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import matplotlib.ticker as mticker
1818

19+
# Fixing random state for reproducibility
1920
np.random.seed(19680801)
2021

2122
UNIT = "Hz"

lib/matplotlib/tests/test_ticker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,9 @@ def test_engformatter_offset_oom(
16451645
# only makes sure that offset text and the ticks gets the correct unit
16461646
# prefixes and the ticks.
16471647
if formatter.offset:
1648+
# These prefix_ variables are used only once, so we could have inlined
1649+
# them all, but it is more comfortable in case of tests breakages to
1650+
# view their values with pytest --showlocals.
16481651
prefix_noise_got = offset_got[2]
16491652
prefix_noise_desired = formatter.ENG_PREFIXES[oom_noise_desired]
16501653
prefix_center_got = offset_got[-1-len(UNIT)]
@@ -1659,7 +1662,8 @@ def test_engformatter_offset_oom(
16591662
assert offset_got == ""
16601663
# Make sure the ticks contain now the prefixes
16611664
for tick in ticks_got:
1662-
# 0 is zero on all orders of magnitudes, no
1665+
# 0 is zero on all orders of magnitudes, no matter what is
1666+
# oom_noise_desired
16631667
if tick[0] == "0":
16641668
prefix_idx = 0
16651669
else:

lib/matplotlib/ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,8 +1464,8 @@ def set_locs(self, locs):
14641464

14651465
# Simplify a bit ScalarFormatter.get_offset: We always want to use
14661466
# self.format_data. Also we want to return a non-empty string only if there
1467-
# is an offset, no matter what is self.orderOfMagnitude. if there is an
1468-
# offset OTH, self.orderOfMagnitude is consulted. This behavior is verified
1467+
# is an offset, no matter what is self.orderOfMagnitude. If there _is_ an
1468+
# offset, self.orderOfMagnitude is consulted. This behavior is verified
14691469
# in `test_ticker.py`.
14701470
def get_offset(self):
14711471
# docstring inherited

0 commit comments

Comments
 (0)