Are there algorithms for generating aesthetically pleasing scatter plots?

497 Views Asked by At

I'm tinkering around with making a bokeh generator. Currently, all the positions are random, but the results are not often visually pleasing.
It seems that what looks good is having around 3 'clusters' somewhat spaced out.

Are there any algorithms for generating scatter plots with constraints like that? I feel like this should be a solved problem, but I'm not familiar with this area (I have very little math background) and I'm not sure where to start looking.

Looks decent:
enter image description here

Too scattered: enter image description here:

Too clustered: enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER

I do not know if such algorithms exist but here is an untested heuristic. You want to identify clusters and discourage circles that don't belong to chosen clusters. You could choose distances $a$ and $b$ ($a<b$) such that two circles separated by $a$ are close while two circles separated by more than $b$ are far. The difference $b-a$ may be the common radius of the circles. Consider a cluster to be a maximal group of circles such that you cannot divide the group into two subgroups of circles such that no circle in one group is close to any circle in the other subgroup.

Also choose a low probability $p$ with which you will allow a circle even if it violates $3$ cluster requirement. Start with $0$ clusters. Randomly generate circles. A circle stays if it is close to a circle from one existing cluster but is far from all circles in other clusters. It also stays and forms a new cluster if it is far from all existing circles and there are less than three clusters before the current circle is added. Even if the circle does not satisfy the previous two requirements, it may be retained with probability $p$ but would be ignored in future comparisons for inclusion of new circles. Stop when each of the 3 clusters has a certain minimum number of circles.

0
On

This is really vague, but you could make a circle, then turn 60 degrees in a random direction and plot another circle, then turn 60 to somewhere and another, etc. This should theoretically give a nice little triangle dot pattern. Postulating here.