1. remote ssh的配置文件config中添加
Host Jupyter-Server
HostName <IP>
ForwardX11 yes
ForwardX11Trusted yes
ForwardAgent yes
User <Username>
2. 在远程服务器的.sshd_config中把X11forward的开关打开为yes
3. 在home文件夹中更改.bashrc,加入以下内容
export DISPLAY='localhost:10.0'
4. 运行以下命令,并检查echo的输出是否localhost:10.0文章来源:https://www.toymoban.com/news/detail-694701.html
source ./bashrc
echo $DISPLAY
5. 在本地vscode中连接到刚刚创建的jupyter-server,测试是否能显示图像文章来源地址https://www.toymoban.com/news/detail-694701.html
import matplotlib.pyplot as plt
from plyfile import *
from mpl_toolkits.mplot3d import Axes3D
plydata = PlyData.read(datadir + datapath)
xlist = plydata['vertex']['x']
ylist = plydata['vertex']['y']
zlist = plydata['vertex']['z']
fig = plt.figure()
ax = Axes3D(fig,auto_add_to_figure=False)
fig.add_axes(ax)
ax.scatter(xlist, ylist, zlist)
plt.show()
到了这里,关于VScode连接远程JupyterNotebook显示点云ply文件的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!