Organize TSNE data into grid I have some data reduced by TSNE into a 2D representation, which shows clear spatial features.



However, I'd like to format this into a grid – not just snapping data to the nearest grid square but spreading everything out to fill up a grid, preserving (as much as possible) the existing spatial relationships.

So far, I've only found this article which might close to what I need? This process might already have a name and I'm just one step from an easy Google solution, but at the moment I'm stuck!
There seem to be a few options, but I found rasterfairy which is very easy to install and use. Has the added bonus of being able to fit to a rectangular grid, but also circular and other arbitrary shapes.

A very nice IronPython notebook example: https://github.com/Quasimondo/RasterFairy/blob/master/examples/Raster%20Fairy%20Demo%201.ipynb

And some example results: