Say I have a regular grid of nxn
points, and a dictionary telling me how many times something happens in each one of the points:
d={
(0, 0): 1114,
(0, 1): 270,
(3, 2): 217,
(5, 6): 189,
(10, 10): 164}
I want to plot a scatter of these points, the size of the markers being assigned by the corresponding value of the dict. How can I do this?
I know I can draw a scatter like this, but how to structure s
, the list of sizes?
#Import section
#defining d
xticks = [0,1,2,3,4,5,6,7,8,9,10]
yticks = [0,1,2,3,4,5,6,7,8,9,10]
plt.xticks(xticks)
plt.yticks(yticks)
plt.xlabel("x")
plt.ylabel("y",rotation=0)
plt.title('my map')
s=[] #How to structure this?
plt.scatter(x, y,color='yellow',s=s)
plt.show()