标签: python python-3.x matplotlib imshow
我需要在imshow中代表一个RGB点,但我没有得到它,有人可以帮我吗?
反击
R = 1.0 G = 0.7042952754521196 B = 0.019247748523127214
Código
x = np.array([R, G, B]) x.shape = () plt.imshow(x) plt.colorbar() plt.show()
答案 0 :(得分:2)
如果要绘制RGB颜色,则说明操作正确:
import matplotlib.pyplot as plt R = 1.0 G = 0.7042952754521196 B = 0.019247748523127214 plt.imshow([[(R, G, B)]])