plotly / plotly/plotly.R

facet_wrap causing NA values

Open
#897 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The upper tile in the following example is changed by ggplotly. I assume it is grey because it is somehow NA. Only occurs when faceting is used.

test <- structure(list(week = c(7L, 7L, 32L), day = structure(c(5L, 6L, 
1L), .Label = c("Mon", "Tues", "Wed", "Thurs", "Fri", "Sat", 
"Sun"), class = c("ordered", "factor")), year = c(2017, 2017, 
2015), `Samples #` = c(31L, 49L, 20L)), class = c("tbl_df", "tbl", 
"data.frame"), row.names = c(NA, -3L), .Names = c("week", "day", 
"year", "Samples #"))

p <- ggplot(data = test, aes(x = day, y = week, fill = `Samples #`, height = 1)) +
geom_tile() +
facet_wrap(~year, ncol = 1) 

p

image

ggplotly(p)
image

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

Start by running the provided R reproduction with ggplot, geom_tile, facet_wrap, and ggplotly(p), then compare the faceted output with the original plot. Done means the upper tile retains the correct value and appearance instead of becoming grey or NA when faceting is used.

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.