Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e20d9b commit ed1c830Copy full SHA for ed1c830
lib/matplotlib/ticker.py
@@ -712,7 +712,14 @@ def _set_orderOfMagnitude(self, range):
712
# fixed scaling when lower power limit = upper <> 0.
713
self.orderOfMagnitude = self._powerlimits[0]
714
return
715
- locs = np.abs(self.locs)
+ # restrict to visible ticks
716
+ vmin, vmax = sorted(self.axis.get_view_interval())
717
+ locs = np.asarray(self.locs)
718
+ locs = locs[(vmin <= locs) & (locs <= vmax)]
719
+ locs = np.abs(locs)
720
+ if not len(locs):
721
+ self.orderOfMagnitude = 0
722
+ return
723
if self.offset:
724
oom = math.floor(math.log10(range))
725
else:
0 commit comments