Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d220cbc

Browse files
committed
BUG: correctly convert labelsize -> int
Do this by getting the size value back from the underlying text object.
1 parent bb301f1 commit d220cbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/axis.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,11 @@ def _apply_params(self, **kw):
307307
label_kw = dict([(k[5:], v) for (k, v) in label_list])
308308
self.label1.set(**label_kw)
309309
self.label2.set(**label_kw)
310-
for k, v in label_kw.iteritems():
310+
for k in label_kw.iterkeys():
311+
# for labelsize the text objects covert str ('small')
312+
# -> points. grab the integer from the `Text` object
313+
# instead of saving the string representation
314+
v = getattr(self.label1, 'get_' + k)()
311315
setattr(self, '_' + k, v)
312316

313317

0 commit comments

Comments
 (0)