linnarsson-lab / loom-viewer

Tool for sharing, browsing and visualizing single-cell data stored in the Loom file format
BSD 2-Clause "Simplified" License
35 stars 6 forks source link

[scatterplot] "lock ratio" option for x/y attributes #125

Open JobLeonard opened 7 years ago

JobLeonard commented 7 years ago

Currently, scatterplots just project the min/max values to the edges of the available canvas. In some cases that you get plots that can be interpreted:

image

(mental note: implement labeling individual columns when plotting categorical attributes)

image

But it looks awkward if the ratio of the attributes doesn't match the ratio of the canvas:

image

image

image

In order to fix this, I propose we add a "lock x/y ratio" option. What this would to is set the ratio of the plot to the min/max delta of each attribute.

So let's say tSNE1 has values between -2 and +3, and tSNE2 has values between -0.5 and +1, then the ratio is 10:3, and when selecting lock ratio the plot is scaled to make it fit that ratio, while maximised for available visible canvas space.

Especially for default clustering attributes¹ this makes sense, since they are supposed to match each other in magnitude.

¹ That is to say: X and _Y, _tSNE1 and _tSNE2, _PC1 and _PC2, _LogMean and _LogCV*.