bug 经历
今天又遇到了一个奇怪的 bug,因为在前几天我都能正常使用 matplotlib
进行画图,但是今天却不行了,我还很好奇是不是我的代码有问题,就想着运行以下前两天写的画图代码,发现也报错了,报错信息如下:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'
为什么只有这一行呢?因为我现在想复现那个bug又复现不了了(复现之后它变成了别的bug了),不过大致报错信息可以看:https://github.com/matplotlib/matplotlib/issues/24374
,应该是差不多的,可能有的小伙伴上不了 github
,我这里也把 github 上的报错信息复制过来:
Traceback (most recent call last):
File "dt.py", line 14, in <module>
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2817, in scatter
__ret = gca().scatter(
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2272, in gca
return gcf().gca(**kwargs)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 865, in gcf
return figure()
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 809, in figure
FigureClass=FigureClass, **kwargs)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 324, in new_figure_manager
_warn_if_gui_out_of_main_thread()
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 314, in _warn_if_gui_out_of_main_thread
if (_get_required_interactive_framework(_get_backend_mod())
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 217, in _get_backend_mod
switch_backend(