I want to plot a scatter plot with 4 specified colors of my choice, preferably a good combination with RGB, when provided a weighting array like the following example where I am plotting with 3 colors.
import numpy as np
import matplotlib.pyplot as plt
x = np.array([1,2])
y = np.array([[2,3],[1,4]])
color = [[0.8, 0.1, 0.1],
[0.1, 0.8, 0.1],
[0.1, 0.1, 0.8],
[0.1, 0.8, 0.1]]
plt.scatter(np.repeat(x, y.shape[1]), y.flat, s=100, c=color)
Since by default python makes this an RGB plot the plot looks like this --
Now, If I want to plot with a color array that has 4 elements the plot is not so good to illustrate information in useful way in the RGBA plot.
import numpy as np
import matplotlib.pyplot as plt
x = np.array([1,2])
y = np.array([[2,3],[1,4]])
color = [[0.9, 0.1, 0.1, 0.1],
[0.1, 0.9, 0.1, 0.1],
[0.1, 0.1, 0.9, 0.1],
[0.1, 0.1, 0.1, 0.9]]
plt.scatter(np.repeat(x, y.shape[1]), y.flat, s=100, c=color)
because the plot looks like this --
what is the best way to have specified colors, for example, red, green, blue and golden? in other words, can I make the scatter plot in a way so that first column of color array represents red, second column represents green, third represents blue and fourth column represents golden (instead of transparency). And the values in each column will specify the shade of the specific color.



