Skip to content

dots overlay each other indepedent of 3D coordinates when size is specified #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SansMorel opened this issue Jan 13, 2020 · 1 comment

Comments

@SansMorel
Copy link

Hi,

I am making 3D plots and coloring the dots based on which cluster they belong to.
the issue only seems to arise when the size is specified.
It's difficult to illustrate with pictures since it is in 3D, but basically dots that are behind other dots in 3D, overlay dots in front of them.

#umap.3d is character vector of umap colnames in data
library(plotly)
p <-plot_ly(
  x = data[, umap.3d[1]],
  y = data[, umap.3d[2]],
  z = data[, umap.3d[3]],
  type="scatter3d",
  mode = "markers",
  size = 1,
  color = as.factor(data$kmeans_clustering)) %>%
  layout(
    title = "Clusters"
  );p

Pay attention to the pink and orange cluster down to the right. Here they are on top of all other dots.
image

After changing the angle you can see that they actually belong to another population far in the back.
image

Now without any size parameter.

p <-plot_ly(
  x = data[, umap.3d[1]],
  y = data[, umap.3d[2]],
  z = data[, umap.3d[3]],
  type="scatter3d",
  mode = "markers",
  color = as.factor(data$kmeans_clustering)) %>%
  layout(
    title = "pheno_clusters"
  );p

image
image

@SansMorel
Copy link
Author

plotly/plotly.js#1267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant