剧情方面未正确翻译 [英] Plotly Facets not translating properly

查看:106
本文介绍了剧情方面未正确翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在使用R的Plotly时,当我面对图时,它们通常无法正确地从R转换为Plotly.

I've found that with Plotly with R, when I'm faceting plots, they often don't translate properly from R to Plotly.

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

For example, my graph plotted in R looks like so:

当我将其发送到Plotly时,它看起来像这样:

When I send it to plotly, it looks like so:

(出于保密原因,在两个图中都隐藏了一些数据)

(Some data has been hidden from both plots for confidentiality reasons)

我的代码如下:

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"))

推荐答案

我最后使用facet_grid代替了facet_wrap.像这样:

I wound up using facet_grid instead of facet_wrap. Something like this:

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

这篇关于剧情方面未正确翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆