Plotly Facets没有正确翻译

时间:2015-03-05 20:16:46

标签: facet plotly

我发现使用Plotly和R,当我面对阴谋时,他们往往不能正确地从R转换为Plotly。

例如,我在R中绘制的图表如下所示:

enter image description here

当我把它发送到情节时,它看起来像是这样:

enter image description here

(出于保密原因,某些数据已从两个图中隐藏)

我的代码如下:

plot <- ggplot(sytoxG_data_no_NC) +
  geom_ribbon(data = confidence_intervals_SG, mapping = aes(x = time_elapsed, ymin = phenotype_value.NC.lower, ymax = phenotype_value.NC.upper,
                                                            fill = "red", colour = NULL), alpha = 0.6) +
  scale_fill_manual(name = "Legend",
                    values = c('red'),
                    labels = c('Negative Control')) +
  xlab("Time Elapsed") +
  ylab("Sytox Green") +
  ggtitle("Sytox Green - Facets: Pathway") +
  facet_wrap(~Pathway, ncol=6, scales = "fixed") +
  theme(panel.grid = element_blank(),
        axis.ticks.length = unit(0, "cm"),
        panel.background = element_rect(fill = "white"),
        strip.text.x = element_text(size=4),
        axis.text = element_blank())
response <- py$ggplotly(plot, kwargs=list(world_readable=FALSE, filename="SG_sparklines_by_pathway", fileopt="overwrite"))

2 个答案:

答案 0 :(得分:0)

问题很可能与geom_ribbon而不是方面有关......你能否升级你的“情节”套餐并再试一次?

答案 1 :(得分:0)

我使用facet_grid代替facet_wrap。像这样:

+ facet_grid(~Pathway, scales = "free", space="free")