Skip to content

Commit 253eac3

Browse files
committed
fix sticky-handling of 0 with log scale
1 parent 1285264 commit 253eac3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,10 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
22062206
stickies = [artist.stickies for artist in self.get_children()]
22072207
x_stickies = sum([sticky.x for sticky in stickies], [])
22082208
y_stickies = sum([sticky.y for sticky in stickies], [])
2209+
if self.get_xscale().lower() == 'log':
2210+
x_stickies = [xs for xs in x_stickies if xs > 0]
2211+
if self.get_yscale().lower() == 'log':
2212+
y_stickies = [ys for ys in y_stickies if ys > 0]
22092213
else: # Small optimization.
22102214
x_stickies, y_stickies = [], []
22112215

0 commit comments

Comments
 (0)