Skip to content

Commit 16ae44f

Browse files
committed
Fix _loc_translate bug
1 parent 1ab92ca commit 16ae44f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

proplot/axes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,13 @@ def _loc_translate(loc, default=None):
345345
if loc in (None, True):
346346
loc = default
347347
elif isinstance(loc, (str, Integral)):
348-
try:
349-
loc = LOC_TRANSLATE[loc]
350-
except KeyError:
351-
raise KeyError(f'Invalid location {loc!r}.')
348+
if loc in LOC_TRANSLATE.values(): # full name
349+
pass
350+
else:
351+
try:
352+
loc = LOC_TRANSLATE[loc]
353+
except KeyError:
354+
raise KeyError(f'Invalid location {loc!r}.')
352355
elif np.iterable(loc) and len(loc) == 2 and all(
353356
isinstance(l, Number) for l in loc):
354357
loc = np.array(loc)

0 commit comments

Comments
 (0)