Skip to content
Features
Business
Explore
Marketplace
Pricing
This repository
Sign in
or
Sign up
Watch
440
Star
5,572
Fork
2,667
matplotlib
/
matplotlib
Code
Issues
992
Pull requests
229
Projects
5
Wiki
Insights
Pulse
Graphs
Choose offset text from ticks, not axes limits.
#5780
Merged
tacaswell
merged 1 commit into
matplotlib
:
master
from
anntzer
:
offsettext-uses-ticks-not-axes-limits
Jan 1, 2016
Conversation
4
Commits
1
Files changed
1
Changes from
all commits
Commits
Show all changes
1 commit
Select commit
4d45592
Choose offset text from ticks, not axes limits.
anntzer
Jan 1, 2016
1 file
Jump to file
No files or symbols found.
+3
−0
ticker.py
lib/matplotlib/ticker.py
+3
−0
Unified
Split
Show comments
View
3
lib/matplotlib/ticker.py
@@ -559,6 +559,9 @@ def _set_offset(self, range):
if
locs
is
None
or
not
len
(locs)
or
range
==
0
:
self
.offset
=
0
return
+ vmin, vmax
=
sorted
(
self
.axis.get_view_interval())
+ locs
=
np.asarray(locs)
+ locs
=
locs[(vmin
<=
locs)
&
(locs
<=
vmax)]
ave_loc
=
np.mean(locs)
if
ave_loc:
#
dont want to take log10(0)
ave_oom
=
math.floor(math.log10(np.mean(np.absolute(locs))))
Toggle all file notes
You can't perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.