You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug on savefig when xlabelpad != ylabelpad (I think). Would complete all plotting code but throw: TypeError: can't multiply sequence by non-int of type 'float' when savefig is called. vscode traceback leads to this line:
lukelbd
changed the title
TypeError: can't multiply sequence by non-int when separate labelpads are given
TypeError when passing unit-string xlabelpad or ylabelpad to format
Mar 29, 2023
This should be fixed by d44b25b. Axis label keyword args are now run through the rc setting validators, so that xlabelpad and ylabelpad unit-strings get converted to points. Example:
Description
Bug on savefig when xlabelpad != ylabelpad (I think). Would complete all plotting code but throw: TypeError: can't multiply sequence by non-int of type 'float' when savefig is called. vscode traceback leads to this line:
self.label.set_position(
(x, bottom - self.labelpad * self.figure.dpi / 72)
)
I think self.labelpad is a list in this case, or similar, causing the error on multiplication. This resolved after changing subplots call from
xlabelpad='.5em',
ylabelpad='.3em',
to
labelpad='.3em',
Steps to reproduce
a 1x2 figure with a panel, axes creation/format calls were:
Expected behavior: To render and save fig normally if separate label pads are given.
Actual behavior: Crash on savefig
The text was updated successfully, but these errors were encountered: