Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into add-plotting-methods
  • Loading branch information
lukelbd committed Feb 11, 2020
commit 29b4da6d95f3b26c9c6222bae41621348dec4a98
1 change: 0 additions & 1 deletion docs/.proplotrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
small: 9
large: 10
inlinefmt: svg
matplotlib: auto
docstring.hardcopy: True
34 changes: 17 additions & 17 deletions proplot/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,17 +1715,15 @@ def legend(self, *args, loc=None, width=None, space=None, **kwargs):
----------
%(legend_args)s
loc : int or str, optional
The legend location or panel location. The following location keys
are valid. Note that if a panel does not exist, it will be
generated on-the-fly.
The legend location. The following location keys are valid:

================== =======================================
Location Valid keys
================== =======================================
left panel ``'left'``, ``'l'``
right panel ``'right'``, ``'r'``
bottom panel ``'bottom'``, ``'b'``
top panel ``'top'``, ``'t'``
outer left ``'left'``, ``'l'``
outer right ``'right'``, ``'r'``
outer bottom ``'bottom'``, ``'b'``
outer top ``'top'``, ``'t'``
"best" inset ``'best'``, ``'inset'``, ``'i'``, ``0``
upper right inset ``'upper right'``, ``'ur'``, ``1``
upper left inset ``'upper left'``, ``'ul'``, ``2``
Expand All @@ -1739,22 +1737,23 @@ def legend(self, *args, loc=None, width=None, space=None, **kwargs):
================== =======================================

width : float or str, optional
The space allocated for outer legends. This does nothing
if :rcraw:`tight` is ``True``. Units are interpreted by
`~proplot.utils.units`.
For outer legends only. The space allocated for the legend box.
This does nothing if :rcraw:`tight` is ``True``. Units are
interpreted by `~proplot.utils.units`.
space : float or str, optional
The space between the axes and the legend for outer legends.
Units are interpreted by `~proplot.utils.units`.
For outer legends only. The space between the axes and the legend
box. Units are interpreted by `~proplot.utils.units`.
When :rcraw:`tight` is ``True``, this is adjusted automatically.
Otherwise, defaut is :rc:`subplots.panelspace`.
Otherwise, the default is :rc:`subplots.panelpad`.
%(legend_kwargs)s

Other parameters
----------------
*args, **kwargs
Passed to `~proplot.wrappers.legend_wrapper`.
"""
loc = self._loc_translate(loc, width=width, space=space)
if loc != '_fill':
loc = self._loc_translate(loc, 'legend')
if isinstance(loc, np.ndarray):
loc = loc.tolist()

Expand All @@ -1775,9 +1774,10 @@ def legend(self, *args, loc=None, width=None, space=None, **kwargs):
# Try to make handles and stuff flush against the axes edge
kwargs.setdefault('borderaxespad', 0)
frameon = _notNone(
kwargs.get(
'frame', None), kwargs.get(
'frameon', None), rc['legend.frameon'])
kwargs.get('frame', None),
kwargs.get('frameon', None),
rc['legend.frameon']
)
if not frameon:
kwargs.setdefault('borderpad', 0)
# Apply legend location
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.