Skip to content

ENH: use an artist's update() method instead of the setp() function #2291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2013
Merged
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
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def __init__(self, fig, rect,
self.set_yscale(yscale)

if len(kwargs):
martist.setp(self, **kwargs)
self.update(kwargs)

if self.xaxis is not None:
self._xcid = self.xaxis.callbacks.connect('units finalize',
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def grid(self, b=None, which='major', **kwargs):
continue
tick.gridOn = self._gridOnMinor
if len(kwargs):
artist.setp(tick.gridline, **kwargs)
tick.gridline.update(kwargs)
self._minor_tick_kw['gridOn'] = self._gridOnMinor
if which in ['major', 'both']:
if b is None:
Expand All @@ -1319,7 +1319,7 @@ def grid(self, b=None, which='major', **kwargs):
continue
tick.gridOn = self._gridOnMajor
if len(kwargs):
artist.setp(tick.gridline, **kwargs)
tick.gridline.update(kwargs)
self._major_tick_kw['gridOn'] = self._gridOnMajor

def update_units(self, data):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(self,
self._combined_transform = transforms.IdentityTransform()

if len(kwargs):
artist.setp(self, **kwargs)
self.update(kwargs)

def get_verts(self):
"""
Expand Down