Commit 0d0583be authored by Yori Fournier's avatar Yori Fournier
Browse files

Merge branch '32-bug-axes-update' into 'dev'

Resolve "BUG: if you give keywords to an Axes in constructor rise error"

Closes #32

See merge request !31
parents cc9dc5c0 647248b8
......@@ -66,7 +66,7 @@ class MyAxes(Axes):
Axes.__init__(self, fig, rect, **kwargs)
# set a default name. Should be individualized by instance
self.name='default'
self.name = 'default'
# COMPUTE RECT -------------------------------------------------------
......@@ -109,9 +109,13 @@ class MyAxes(Axes):
return(True)
# UPDATE -------------------------------------------------------------
def update(self, **kwargs):
def update(self, *args, **kwargs):
for key in kwargs.keys():
if key in self.keywords.keys():
self.keywords[key] = kwargs[key]
# Because matplotlib.axes.update expect kwargs and not **kwargs ... (stupid!!)
if args: # catch matplotlib kwargs
kwargs = args[0]
kw_for_axes = {key: value for (key, value) in args[0].items() if key not in self.keywords}
Axes.update(self, kw_for_axes) # update matplotlib.Axes
# myplotlib update
self.keywords.update({key: value for (key, value) in kwargs.items() if key in self.keywords})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment