I have a question regarding the colorbar of the matplotlib.
The scatter is set with x, y and size. My intention was to plot 200 both random size and random color dots. And colors are given with a 200*3 matrix. The pic is right while the colorbar shows error.
I realize it was something wrong with the colorbar() input type. But i don't know how to configure or fix it. Can anyone please help me? Thanks.
import numpy as np
import matplotlib.pyplot as plt
x = np.random.rand(200)
y = np.random.rand(200)
size = np.random.rand(200) * 200
color = np.array(np.random.rand(200*3))
color.shape = 200, 3
pic = plt.scatter(x, y, size, color)
plt.colorbar()