I'd like to make a scatter plot from a Dataframe, where each point is visualized with a unique color in dependence how often that value occured. As example, I have the following dataframe, consisting of lists of two numeric values:
df = pd.DataFrame({'width': image_widths, 'height': image_heights})
df.head(10)
height width
0 1093 640
1 1136 639
2 1095 640
3 1136 639
4 1095 640
5 1100 640
6 1136 640
7 1136 639
8 1136 640
9 1031 640
Now, as you see, some value-pairs occure multiple times. For example (1095/640) occures at index 2 and 4. How do I give this dot a color representing "Two occurences". And it would be even better, if the color is picked automatically from a continous spectrum, like in a colorbar plot. Such that already the color-shade gives you an impression of the frequency, rather then by manually looking up what the color represents it.
An alternative to coloring, I also would appreciate, is having the frequency of occurences coded as radius of the dots.
EDIT:
To specify my question, I figured out, that df.groupby(['width','height']).size() gives me the count of all combinations.
Now I lack the skill to link this information with the color (or size) of the dots in the plot.
