Skip to content

Commit

Permalink
Fix issue updating label color erases label text
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Sep 27, 2021
1 parent e77c455 commit 7a7852f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions proplot/axes/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,15 @@ def _update_labels(self, x, *args, **kwargs):
# later so that labels set with set_xlabel() and set_ylabel() are shared too.
# See notes in _align_axis_labels() and _apply_axis_sharing().
kwargs = self._get_label_props(**kwargs)
if all(a is None for a in args) and all(v is None for v in kwargs.values()):
no_args = all(a is None for a in args)
no_kwargs = all(v is None for v in kwargs.values())
if no_args and no_kwargs:
return # also returns if args and kwargs are empty
getattr(self, 'set_' + x + 'label')(*args, **kwargs)
setter = getattr(self, 'set_' + x + 'label')
getter = getattr(self, 'get_' + x + 'label')
if no_args: # otherwise label text is reset!
args = (getter(),)
setter(*args, **kwargs)

def _update_locators(
self, x, locator=None, minorlocator=None, *,
Expand Down

0 comments on commit 7a7852f

Please sign in to comment.