plotly / plotly.R

An interactive graphing library for R
https://plotly-r.com
Other
2.55k stars 625 forks source link

plot_dendro renders with the graph all squashed to the right #1391

Open ChristelSwift opened 5 years ago

ChristelSwift commented 5 years ago

when i run this code:

library(plotly)

set.seed(3)
N <- 50
df <- data.frame(x = rnorm(N), y = rnorm(N))
rownames(df) <- paste0("p_", 1:N) 

dend <- as.dendrogram(hclust(dist(df)))
plot_dendro(dend)

i end up with the dendrogram all squashed to the right:

image

Any idea how i can force it to fill in the entire graph viewer?

cpsievert commented 5 years ago

Huh, weird, you can set the range manually this way: plot_dendro(dend) %>% layout(xaxis = list(range = c(-1, 5)))

ChristelSwift commented 5 years ago

yep, that worked! thanks very much :)