Titor的自留地


  • Home

  • Tags

  • Archives

在无界面环境下运行matplotlib

Posted on 2018-04-01 |

在没有安装图形界面的服务器上使用matplotlib绘图,会在import相应包的时候报错。
只需要在导入matplotlib包之前,执行下面两行语句,就可以解决这个问题。

1
2
import matplotlib as mpl
mpl.use('Agg')
# python # 科学计算 # snippets # matplotlib
Python元类
使用scipy进行一维插值运算
Titor

Titor

7 posts
11 tags
GitHub E-Mail
© 2019 Titor
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4