Привет интернет. Возникли проблемы с рендерингом ggplotly тепловой карты, сгенерированной в ggplot2. По какой-то причине он обрезает первые несколько строк графика.
Вот первые несколько строк кадра данных:
Gene Swissprot tab condition foldchange
1 Xvis03_203700 Bidirectional sugar transporter SWEET16 transport NST_75 6.8
2 Xvis03_205865 DPH3 homolog transport NST_75 1.9
3 Xvis03_201037 DUF21 domain_containing protein At4g14240 transport NST_75 0.7
4 Xvis03_217938 Vacuolar iron transporter 1.2 transport NST_75 6.9
5 Xvis03_225321 Copper transport protein ATX1 transport NST_75 1.0
6 Xvis03_200929 Copper_transporting ATPase PAA1, chloroplastic transport NST_75 2.5
Вот мой код:
library(wesanderson)
pal <- wes_palette("Zissou1", 20, type = "continuous")
level_order <- factor(heat_trans$condition, levels = c("NST_75", "NST_55", "NST_35", "NST_AD", "NST_RH",
"PST_75", "PST_55", "PST_35", "PST_AD", "PST_RH",
"ST_FT","ST_75", "ST_55", "ST_35", "ST_AD", "ST_RH"))
trans.heatmap <-
ggplot(heat_trans) +
geom_tile(aes(x = level_order, y = Swissprot, fill = foldchange)) +
scale_fill_gradientn(colours = pal, na.value = "grey50")+
ggtitle("Desiccome Transport Genes")+
theme(axis.text.x = element_text(angle=90),
plot.background = element_rect(colour = "white"),
axis.ticks = element_blank(),
axis.title = element_blank())
trans.heatmap #for ggplot version
ggplotly(trans.heatmap, tooltip = c("Swissprot", "foldchange")) #for ggplotly version
Это версия тепловой карты ggplot: ![This is the ggplot version of the heatmap](https://i.stack.imgur.com/8Ed3T.jpg)
Это версия тепловой карты ggplot: ![This is the ggplotly version of the heatmap](https://i.stack.imgur.com/UlWax.jpg)
Эта версия ggplotly уменьшена, чтобы продемонстрировать, что масштабированиене проблема: ![This is the ggplotly version zoomed out to demonstrate that zooming is not the issue](https://i.stack.imgur.com/ZzuiM.jpg)
Спасибо за любую помощь и совет!