Skip to content

Commit 63eaf39

Browse files
committed
Remove missing values in ticktext/tickvals
As discussed in tidyverse/ggplot2#3566 (comment), it's now possible for the ggplot2 labels/positions to contains missing values, and we should be able to simply ignore them
1 parent 9bcf90a commit 63eaf39

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/ggplotly.R

+3
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,9 @@ gg2list <- function(p, width = NULL, height = NULL,
686686
ticktext <- rng[[xy]]$get_labels %()% rng[[paste0(xy, ".labels")]]
687687
tickvals <- rng[[xy]]$break_positions %()% rng[[paste0(xy, ".major")]]
688688

689+
ticktext <- ticktext[!is.na(ticktext)]
690+
tickvals <- tickvals[!is.na(tickvals)]
691+
689692
axisObj <- list(
690693
# TODO: log type?
691694
type = if (isDateType) "date" else if (isDiscreteType) "category" else "linear",

0 commit comments

Comments
 (0)