Centos 7 matplotlib 远程绘图

来源:互联网 发布:简单工程造价软件 编辑:程序博客网 时间:2024/06/06 10:41
  1. 安装在Centos上安装xterm,xauth,xorg-x11-apps:

    #yum install xterm#yum install xauth#yum install xorg-x11-apps
  2. 修改/etc/ssh/sshd_config
    这里写图片描述
    重启sshd.service
    重启一个ssh连接
    检测是否$DISPLAY变量设置成功
    这里写图片描述

  3. 在wondows平台安装xming,默认xming运行在locahost:0.0

  4. 在putty中打开x11转发
    这里写图片描述
  5. 在putty中运行matplotlib程序,图像会通过x11 远程传输到 windows putty客户端上,由xming进行绘图
    这里写图片描述
  6. 可以在pycharm中配置Run的运行环境
    这里写图片描述
    注意localhost地址的值要与2中 ssh客户端中打印出的$DISPALY值一致,不然图像转发会出错