Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df61898

Browse files
committed
Use consistent array shape when setting square axis.
NumPy 1.18.x will not like setting an array slice with a ragged array like this.
1 parent 5e5f7bc commit df61898

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ def axis(self, *args, emit=True, **kwargs):
16451645
self.set_autoscale_on(False)
16461646
xlim = self.get_xlim()
16471647
ylim = self.get_ylim()
1648-
edge_size = max(np.diff(xlim), np.diff(ylim))
1648+
edge_size = max(np.diff(xlim), np.diff(ylim))[0]
16491649
self.set_xlim([xlim[0], xlim[0] + edge_size],
16501650
emit=emit, auto=False)
16511651
self.set_ylim([ylim[0], ylim[0] + edge_size],

0 commit comments

Comments
 (0)