Commit ef9e418
committed
Make GridSpec.update docstring match behavior.
The sentence "If any kwarg is None, default to the current value, if
set, otherwise to rc." is clearly wrong given the lines just below,
which overwrite the current value unconditonally:
for k, v in kwargs.items():
if k in self._AllowedKeys:
setattr(self, k, v)
This can also be checked with e.g.
from matplotlib.gridspec import GridSpec
from matplotlib import pyplot as plt
gs = GridSpec(1, 1, left=.5)
gs.update(left=None)
plt.figure().add_subplot(gs[0, 0])
plt.show()
where the update reset left to the rc value.
Given that the behavior has been like that ever since gridspec was added
to matplotlib, it seems better to update the docstring.1 parent af8a720 commit ef9e418
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
260 | | - | |
| 258 | + | |
261 | 259 | | |
| 260 | + | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
| 266 | + | |
268 | 267 | | |
269 | 268 | | |
270 | 269 | | |
| |||
0 commit comments