Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ def update(self, props):

def _internal_update(self, kwargs):
"""
Update artist properties without prenormalizing them, but generating
errors as if calling `set`.
Update artist properties generating errors as if calling `set`, but
without unpacking the dictionary to **kwargs.

The lack of prenormalization is to maintain backcompatibility.
"""
Expand All @@ -1266,7 +1266,7 @@ def set(self, **kwargs):
# docstring and signature are auto-generated via
# Artist._update_set_signature_and_docstring() at the end of the
# module.
return self._internal_update(cbook.normalize_kwargs(kwargs, self))
return self._internal_update(kwargs)

@contextlib.contextmanager
def _cm_set(self, **kwargs):
Expand Down
10 changes: 10 additions & 0 deletions lib/matplotlib/tests/test_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,16 @@ class MyArtist4(MyArtist3):
assert MyArtist4.set is MyArtist3.set


def test_set():
line = mlines.Line2D([], [])
line.set(linewidth=7)
assert line.get_linewidth() == 7

# Property aliases should work
line.set(lw=5)
assert line.get_linewidth() == 5


def test_format_cursor_data_BoundaryNorm():
"""Test if cursor data is correct when using BoundaryNorm."""
X = np.empty((3, 3))
Expand Down
Loading