Skip to content

Commit 00b0ab5

Browse files
Apply suggestions from code review
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 36d75b9 commit 00b0ab5

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,13 +3018,13 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
30183018
for ax in self._shared_axes["x"].get_siblings(self):
30193019
for artist in ax.get_children():
30203020
edges.extend(artist.sticky_edges.x)
3021-
x_stickies = np.sort(edges) if edges else np.array([])
3021+
x_stickies = np.sort(edges)
30223022
if self._ymargin and scaley and self.get_autoscaley_on():
30233023
edges = []
30243024
for ax in self._shared_axes["y"].get_siblings(self):
30253025
for artist in ax.get_children():
30263026
edges.extend(artist.sticky_edges.y)
3027-
y_stickies = np.sort(edges) if edges else np.array([])
3027+
y_stickies = np.sort(edges)
30283028
if self.get_xscale() == 'log':
30293029
x_stickies = x_stickies[x_stickies > 0]
30303030
if self.get_yscale() == 'log':

lib/matplotlib/collections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,13 +1512,15 @@ def _make_verts(self, t, f1, f2, where):
15121512

15131513
self._bbox = transforms.Bbox.null()
15141514
t_where = t.data[where] if np.ma.isMA(t) else t[where]
1515+
f1_where = f1.data[where] if np.ma.isMA(f1) else f1[where]
1516+
f2_where = f2.data[where] if np.ma.isMA(f2) else f2[where]
15151517
n = len(t_where)
15161518
if n > 0:
15171519
pts = np.empty((2 * n, 2)) # Preallocate and fill for speed
15181520
pts[:n, 0] = t_where
1519-
pts[:n, 1] = f1.data[where] if np.ma.isMA(f1) else f1[where]
1521+
pts[:n, 1] = f1_where
15201522
pts[n:, 0] = t_where
1521-
pts[n:, 1] = f2.data[where] if np.ma.isMA(f2) else f2[where]
1523+
pts[n:, 1] = f2_where
15221524
self._bbox.update_from_data_xy(self._fix_pts_xy_order(pts))
15231525

15241526
return [

0 commit comments

Comments
 (0)