我是 Python 新手,我需要將 RGB 光譜繪制為一個(gè) numpy 數(shù)組。對(duì)我來(lái)說(shuō),很明顯我需要提高各個(gè)維度的 RGB 值才能獲得光譜。import numpy as npimport matplotlib.pyplot as plt spectrum = np.zeros([255,255, 3], dtype=np.unit8) #init the array#fill the array with rgb values to create the spectrum without the use of loopsplt.imshow(spectrum)plt.axis('off') # don't show axisplt.show()是否有可能(例如 python 或 numpy 方法)在不使用循環(huán)的情況下創(chuàng)建頻譜?
在python/numpy中繪制rgb頻譜
慕田峪9158850
2021-07-29 09:13:46