python plot
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
#不显示坐标轴
ax.set_xticks([])
ax.set_yticks([])
ax.set_zticks([])
#设置标题
ax.set_title("3D_Curve")
#取消网格
ax.grid(False)
#
ax.plot(x,y,z,linestyle='',linewidth=1.2,marker='3',markersize=5, alpha=0.8, c='green')
-常用marker
-高级marker
例如marker = ‘$ \circledR$’
-常用颜色
画立方体
#立方体
x,y,dx,dy,xx, yy,z,dz= 0,0,200,200,[0,0,200,200,0],[0,200,200,0,0],0,200
ax.plot(xx,yy,[z]*5,color='k',alpha=0.4)
ax.plot(xx, yy, [z+dz]*5, color='k',alpha=0.4)
ax.plot([x,x], [y,y], [z,z+dz], color='k',alpha=0.4)
ax.plot([x,x], [y+dy,y+dy], [z,z+dz], color='k',alpha=0.4)
ax.plot([x+dx,x+dx], [y+dy,y+dy], [z,z+dz], color='k',alpha=0.4)
ax.plot([x+dx,x+dx], [y,y], [z,z+dz], color='k',alpha=0.4)
一些python小问题:
import cv2
报错:qt.qpa.plugin: Could not load the Qt platform plugin. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: cocoa, minimal, offscreen, webgl.
解决:在cv2后添加
import os os.environ.pop("QT_QPA_PLATFORM_PLUGIN_PATH")