Matplotlib pyplot.title(string) returns error

老子叫甜甜 提交于 2019-11-30 17:30:24

It happened to me because I tried to do plot.title = "Some string" so that rewrote the title() method. That's the exact reason why it happens :) . As others have said you just need to restart the kernel, no need to reinstall.

I had the same problem. The code was fine, but in the interpreter, I had previoulsy used incorrect xlabel() calls. re-starting the interpreter (close and reopen it) was enough for me, no need to reinstall all python/matplotlib !

I've had this happen when I've previously accidentally plt.title = ''

After that that function is no longer a function. Restarting python kernel or re-importing plt library can fix it.

Not re-installing. Re-IMPORTING.

Had the same problem olben1, using ipython, anaconda and the --pylab flag. Reinstalled and it worked. Fwiw, using an anaconda env makes the uninstall/reinstall easier..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!