Closed
Description
ggplot 2.2.0 newly added right/top axis placements. ggplotly does not currently respect the axis placement set in the ggplot objects in the resultant html
install.packages("heatmaply")
install.packages("htmlwidgets")
## Ensure v.2.2.0
install.packages("ggplot2")
library("heatmaply")
library("htmlwidgets")
library("ggplot2")
h <- heatmaply(mtcars, return_ppxpy=TRUE,
row_dend_left=TRUE)
## heatmap with axis on right side (link)
h$p <- h$p + scale_y_discrete(position = "right")
ggsave(plot = h$p, file = "left.png")
pl <- ggplotly(h$p)
saveWidget(pl, "left.html", selfcontained=TRUE)
h$p <- h$p + scale_x_discrete(position = "top")
ggsave(plot = h$p, file = "left_top.png")
pl <- ggplotly(h$p)
saveWidget(pl, "left_top.html", selfcontained=TRUE)