gpt4 book ai didi

python - 仅通过 ssh 在远程计算机上开发时如何绘制图形

转载 作者:太空宇宙 更新时间:2023-11-04 01:23:41 24 4
gpt4 key购买 nike

我的桌面没有足够的计算能力,所以我通常在远程工作站上开发和运行程序。但是,经常需要绘制一些图表以可视化正在发生的事情,而我无法直接使用 Putty 来完成此操作。我想知道是否有一些方便的方法可以做到这一点。

最佳答案

您可以使用 gnuplot 直接在终端内绘图。例如:

gnuplot> set terminal dumb
Terminal type set to 'dumb'
Options are 'feed size 79, 24'
gnuplot> set terminal dumb
Terminal type set to 'dumb'
Options are 'feed size 79, 24'
gnuplot> plot(sin(x))


1 ++---------------***---------------+---**-----------+--------**-----++
+ * * + * ** +(sin(x)) ****** +
0.8 ++ * * * * * * ++
| * * * * * * |
0.6 *+ * * * * * * ++
|* * * * * * * |
0.4 +* * * * * * * ++
|* * * * * * * |
0.2 +* * * * * * *++
0 ++* * * * * * *++
| * * * * * * *|
-0.2 ++ * * * * * * *+
| * * * * * * *|
-0.4 ++ * * * * * * *+
| * * * * * * *
-0.6 ++ * * * * * * +*
| * * * * * * |
-0.8 ++ * * * * * * ++
+ * * + ** * + * * +
-1 ++-----**--------+-----------**----+--------------***---------------++
-10 -5 0 5 10

或者,您可以使用 X 转发将图形内容从远程计算机转发到本地计算机。

在 Windows 上(我假设您正在使用它,因为您正在使用 Putty)有一个名为 XMing 的程序可以用来执行此操作。

将 XMing 与 PuTTY 一​​起使用的一些说明:http://www-inst.eecs.berkeley.edu/~cs61a/fa13/pdfs/connect-windows.pdf (请参阅我在下面复制的 PDF 的后半部分)

XMing will give you graphical support for your remote connection.

(1) Download XMing from http://sourceforge.net/project/showfiles.php?group_id=156984 Download both Xming and Xming-fonts

(2) Install both, just go with the default settings again.

(3) Open Xlaunch I like the Multiple Window mode, go with whatever style your heart desires Select Start no client You don’t need to change anything on the next two pages.

(4) Tricky step here, open PuTTY On the left settings bar, Look under Connection open up more setting options for SSH Go to X11, Check Enable X11 Forwarding Enter localhost:0 for X display location Enter Host Name information as per the PuTTY Guide, and connect.

(5) Log in, now try commands like emacs

关于python - 仅通过 ssh 在远程计算机上开发时如何绘制图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19533069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com