I have a set of lines with markers. I want these markers to fade through the colormap, say prism for example, dependant on a function, which gives their temperature. Here is my code:
def virial_temp(M=row1[i][2],z=row1[i][3]):
X = 0.7
Y = 0.3
mu = 1/(2*X + 0.75*Y) #from GL's code
v_v = math.sqrt(G*M*m_sun/(virial_rad(M,z)*1E+3*parsec)) #virial velocity [m/s]
return (mu*m_p*v_v**2/(2*k_b))
line1 = plt.plot([namei - len(row1)*0.5, namej - len(row2)*0.5],[row1[i][3]*10, row2[j][3]*10], c=plt.cm.jet(j), lw=2, marker='o', markerfacecolor=plt.cm.rainbow(virial_temp(M=row1[i][2],z=row2[j][3])), markersize=1.5)
It is only the markerfacecolor part I am struggling with. Lets say if temperature is low (value returned from function is low), the color will the same as the color at the 'first' color on the colormap, and if the tempreture is very high (value returned from function is high), it will be the 'last' color on the colormap. Is there a way to do this?
Any help would be really appreciated as I've been struggling on this for a while now!
Thanks in advance