Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit696f0b1

Browse files
committed
ticker.EngFormatter: Add units to ticks as well
1 parente717682 commit696f0b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎lib/matplotlib/ticker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,11 @@ def __call__(self, x, pos=None):
14351435
xp= (x-self.offset)/ (10.**self.orderOfMagnitude)
14361436
ifabs(xp)<1e-8:
14371437
xp=0
1438-
returnself._format_maybe_minus_and_locale(self.format,xp)
1438+
# The ScalarFormatter.__call__ reads the locale here as well. We
1439+
# don't care about it, and we want the ticks to also get the unit
1440+
# with the best prefix as computed by self.format_data that is
1441+
# produced by it doesn't
1442+
returnself.fix_minus(self.format_data(xp))
14391443

14401444
defset_locs(self,locs):
14411445
# docstring inherited

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp