I'm creating a scatter plot in MatPlotLib and I'm trying to make the color of the points dependent on a third parameter (independent of X and Y). However, setting c=third_variable makes all of the dots the same color.
My plot data is in a dictionary with a tuple of x and y data as the key and the third parameter (frequency, ranges from 1 to about 1000) as its value. Sample item: {[2 10]: 50}
I want the colors of the points tied to frequency. As a starting place, I would like to make it such that dots with high frequency are darker and dots with low frequency are lighter.
Here's my current output:
And here's my code:
for key in pairs_hash:
plt.scatter(key[0], key[1], c=pairs_hash[key], cmap=plt.cm.coolwarm)
plt.show()
Thanks for the help!