Skip to content

Commit c35ca89

Browse files
committed
Better error message for invalid legend locs
1 parent d89134c commit c35ca89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

proplot/axes/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ def _loc_translate(self, loc, mode=None, allow_manual=True):
363363
try:
364364
loc = loc_translate[loc]
365365
except KeyError:
366-
raise KeyError(f'Invalid {mode} location {loc!r}.')
366+
raise KeyError(
367+
f'Invalid {mode} location {loc!r}. Options are: '
368+
+ ', '.join(map(repr, loc_translate)) + '.'
369+
)
367370
elif (
368371
allow_manual
369372
and mode == 'legend'

0 commit comments

Comments
 (0)