剧情上imshow一个RGB点

问题描述 投票:1回答:1

我要代表在imshow一个RGB点,但我没有得到它,谁能帮助我?

输入数据

R = 1.0
G = 0.7042952754521196
B = 0.019247748523127214

代码

x = np.array([R, G, B])
x.shape = ()
plt.imshow(x)
plt.colorbar()
plt.show()
python python-3.x matplotlib imshow
1个回答
2
投票

如果你想绘制一个RGB颜色,你在做正确的事:

import matplotlib.pyplot as plt
R = 1.0
G = 0.7042952754521196
B = 0.019247748523127214
plt.imshow([[(R, G, B)]])

color plot

© www.soinside.com 2019 - 2024. All rights reserved.