plotly / plotly/plotly.R

Line segments in a facet_wrap disappear when maximizing the viewer using ggplotly()

未关闭
#1,303 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ggplotly
主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

Hi,
I am trying to make a line chart with facets with free_y scale.
When I see the plot in the viewer everything looks fine:
image

But when I Zoom the Viewer and maximize the window some segments from the lines disappear.

image
The tooltip however is visible when I roll with the cursor over the missing line.
I have the same issue when I look it into Rmarkdown with fig.height=8, fig.width=11

ploty version - 4.7.1.9000

g5 <-   ggplot(mobile_hor_top14, aes(x=month_p, y= freq, group=1,
               text = paste('CPED: ', Month.Code..Main.CPED.Date.,
                  '<br>Count:', freq))) + 
 geom_line(alpha=0.8, colour="blue", size = 1)+
  scale_x_continuous(breaks = seq(from=min(mobile_hor_top14$month_p), to=max(mobile_hor_top14$month_p), by=2), labels = gsub(" ", "",unique(mobile_hor_top14$Month.Code..Main.CPED.Date.))[seq(1,
diff(range(mobile_hor_top14$month_p))+1, 2)]) +
  xlab("")+
  ylab("") +
  facet_wrap(~prod_name_add, ncol=2, scales="free_y") +
  theme(legend.position="none") + 
     theme(axis.text.x = element_text(angle = 25, hjust = 1),
           strip.text = element_text(size = 8, margin = margin(.1, 0, 0.1, 0, "cm")),
           strip.placement = "outside")

ggplotly(g5, tooltip="text") 

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

在指定尺寸下,于 Viewer 和 R Markdown 中复现提供的、使用 facet_wrap(scales="free_y") 的 ggplotly() 示例,并比较正常渲染和最大化渲染。未指定源文件或测试;当线段在两种布局中都保持可见且工具提示继续正常工作时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。