I am new to matplotlib and I am trying to recreate a figure like the following which is a log-log figure:
I know that I have to use colormap to create such output based on my x and y values. What I can not figure is how to add the legend so it can calculates the values for the colormap variable (e.g. here called "Degree") dynamically. Here is what I've got for a sample figure so far:
from matplotlib import pyplot as plt
x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
y = [125, 32, 54, 253, 67, 87, 233, 56, 67]
color = [str(item/255.) for item in y]
plt.scatter(x, y, s=500, c=color)
plt.show()
Any help would be much appreciated.