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

Skip to content

Commit e07c28f

Browse files
committed
FIX: remove extra try/except
1 parent 2ad34af commit e07c28f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ def apply_aspect(self, position=None):
19391939

19401940
shared_x = self in self._shared_axes["x"]
19411941
shared_y = self in self._shared_axes["y"]
1942-
# Not sure whether we need this check:
1942+
19431943
if shared_x and shared_y:
19441944
raise RuntimeError("set_aspect(..., adjustable='datalim') or "
19451945
"axis('equal') are not allowed when both axes "
@@ -2044,13 +2044,8 @@ def axis(self, *args, emit=True, **kwargs):
20442044
self.set_autoscale_on(True)
20452045
self.set_aspect('auto')
20462046
self.autoscale_view(tight=False)
2047-
# self.apply_aspect()
20482047
if s == 'equal':
2049-
try:
2050-
self.set_aspect('equal', adjustable='datalim')
2051-
except RuntimeError:
2052-
raise RuntimeError("'equal' is not allowed on shared "
2053-
"axes, try 'scaled' instead.")
2048+
self.set_aspect('equal', adjustable='datalim')
20542049
elif s == 'scaled':
20552050
self.set_aspect('equal', adjustable='box', anchor='C')
20562051
self.set_autoscale_on(False) # Req. by Mark Bakker

0 commit comments

Comments
 (0)