我正在嘗試使用 matplotlib 構建一個 3d 繪圖,該繪圖在 [0,0,0] 處有一個點,在 [10,10,10] 處有一個箭袋(向量)“看”它。但是當我運行代碼時,我只得到點。為什么會這樣,我該如何解決?代碼:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = plt.axes(projection="3d")
ax.set_xlim3d(0, 20)
ax.set_ylim3d(0, 20)
ax.set_zlim3d(0, 20)
ax.quiver(10, 10, 10, 0, 0, 0, length=2)
ax.scatter(0,0,0)
plt.show()
uj5u.com熱心網友回復:
IIUC,您正在尋找:
ax.quiver(10, 10, 10, -10, -10, -10, length=1)
輸出:

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/453355.html
標籤:Python matplotlib 3d
上一篇:堆積條形圖的格式索引
