scPlot
scPlot copied to clipboard
3D scatterplots
This would be super cool. I saw that it's missing in hvplot (https://github.com/holoviz/hvplot/issues/225) but how about using plotly for this? I know it wouldn't be visually consistent with bokeh but better than nothing, no?
import chart_studio.plotly as py
import plotly.express as px
import scanpy as sc
import pandas as pd
adata = sc.datasets.paul15()
sc.pp.normalize_total(adata, target_sum=10000)
sc.pp.log1p(adata)
sc.pp.neighbors(adata)
sc.tl.umap(adata, n_components=3)
df = pd.DataFrame(adata.obsm['X_umap'], columns=['x', 'y', 'z'])
df['gene'] = adata[:, 'Gata1'].X
fig = px.scatter_3d(df, x='x', y='y', z='z', color='gene', width=1600, height=1000)
py.iplot(fig) # more options here https://plot.ly/python/3d-scatter-plots/

Seems to work well for categoricals too:

I would love to see this feature in hvplot.