Skip to content

Commit d8f2f7a

Browse files
committed
add plot title to subplot
1 parent 3fb6754 commit d8f2f7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/ggplotly.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL,
4141
plotList <- list()
4242
for (i in seq_len(p$nrow)) {
4343
for (j in seq_len(p$ncol)) {
44-
plotList <- c(plotList, list(pm[i, j]))
44+
plotList <- c(plotList, list(p[i, j]))
4545
}
4646
}
4747
# TODO: how to show x/y titles? Should these be arguments in subplot?
48-
do.call(subplot, c(plotList, list(nrows = p$nrow)))
48+
l <- get_plot(do.call(subplot, c(plotList, list(nrows = p$nrow))))
49+
l$layout$title <- p$title
50+
hash_plot(p$data, l)
4951
}
5052

5153
#' @export

0 commit comments

Comments
 (0)