plotly / plotly/plotly.R

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

Open
#1,303 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ggplotly
Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided ggplotly() example with facet_wrap(scales="free_y") in the Viewer and in R Markdown at the stated dimensions, comparing normal and maximized rendering. No source file or test is named; done means line segments remain visible in both layouts while tooltips continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.