Self contained example:
library(ggplot2)
# If you want to draw arbitrary rectangles, use geom_tile() or geom_rect()df<-data.frame(
x= rep(c(2, 5, 7, 9, 12), 2),
y= rep(c(1, 2), each=5),
z=factor(rep(1:5, each=2)),
w= rep(diff(c(0, 4, 6, 8, 10, 14)), 2)
)
p<- ggplot(df, aes(x, y)) +
geom_tile(aes(fill=z))
Using ggplotly works fine:
library(plotly)
ggplotly(p)

But using subplot makes the left labels disappear:
library(plotly)
subplot(plotly_empty(), p, nrows=1, widths= c(.2,.8), margin=0,
shareX=TRUE, shareY=TRUE, titleX=FALSE, titleY=FALSE)

This bug is important for heatmaply, since we get truncated labels, for example:
devtools::install_github("ropensci/plotly")
devtools::install_github('talgalili/heatmaply')
library(heatmaply)
heatmaply(mtcars, k_row=3, k_col=2)
Self contained example:
Using ggplotly works fine:
But using subplot makes the left labels disappear:
This bug is important for heatmaply, since we get truncated labels, for example: