plotly.R
plotly.R copied to clipboard
geom_density_ridges with plotly
Hi,
I'm trying to work on density plot using geom_density_ridges, it works with ggplot but not with ggplotly. Do you have any suggestion for an alternative or an idea to resolve the issue ?
Thanks
code :
data_to_plot <- read.csv("density_data.csv")
plot <- ggplot(data_to_plot, aes(x = ncounts, y = celltype, fill = celltype, color = celltype)) + geom_density_ridges(alpha = 0.3) + facet_grid(gene ~ dataset + sample) + theme_ridges() + theme(panel.spacing = unit(.05, "lines"), panel.border = element_rect(color = "black", fill = NA, size = 1), strip.background = element_rect(color = "black", size = 1.2), strip.text.x = element_text(margin = margin(0.4, 0.2, 0.4, 0.2, "cm"))) + labs(y = NULL) plot
ggplotly(plot)