Reputation: 57
I need to represent a single RGB point in the imshow but I'm not getting it, can anyone help me?
Dados de entrada
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()
Upvotes: 1
Views: 443
Reputation: 285
If you want to plot a RGB color, you were doing it right:
import matplotlib.pyplot as plt
R = 1.0
G = 0.7042952754521196
B = 0.019247748523127214
plt.imshow([[(R, G, B)]])
Upvotes: 3