I am trying to re-create this plot:
This is what I have so far:
limits = [-2.25,2.25,-2.25,2.25] # [xmin,xmax,ymin,ymax]
x = data['x']
y = data['y']
rows,cols = data.shape
colors = np.array([np.arange(0,1,1/5) for row in range(0,5)]).T
sizes = np.linspace(1,rows+1, num=rows)
plt.scatter(x, y, s=sizes, c = colors, cmap='gist_heat')
plt.xlabel("y")
plt.ylabel("x")
plt.xlim(limits[0],limits[1])
plt.ylim(limits[2],limits[3])
plt.title('2D Data')
plt.show()
How do I get the black to red fade. Apparently I am suppose to use the colors
parameter where 'colors' must be a (n,3) NumPy array, where n is the number of data points and each of the three columns corresponds to an RGB value in the range [0,1]
I get better luck using a (5,5) matrix and a cmap. Thanks in advance for the help!