如何在 Python 中繪製複數?


你可以在極座標圖上繪製複數。如果你有一個複數陣列,可以使用以下方法繪製它

import matplotlib.pyplot as plt
import numpy as np

cnums = np.arange(5) + 1j * np.arange(6,11)
X = [x.real for x in cnums]
Y = [x.imag for x in cnums]
plt.scatter(X,Y, color='red')
plt.show()

這將在複平面中繪製這些數字的影像。

更新日期:18-6 月 -2020

2K+ 次瀏覽

開啟你的 職業生涯

獲得課程認證

開始
廣告
© . All rights reserved.