多个axis.text.x名称着色不适用于ggplotly()

时间:2018-07-26 12:31:27

标签: r ggplot2 ggplotly

我有一个数据框:

HG44 <- data.frame( gene_symbol = c("sads","sdsds","sdasdad","dfds","sdsdd"), panel = c("big","gr","sm","big","big"), variable = c("x","x","y","z","y") , value = c("normal","over","low","normal","low") , colors = c("red","green","yellow","red","red"))

然后我创建一个热图:

library(plotly)
library(ggplot2)
library(reshape2)

pp <- ggplot(HG44, aes(gene_symbol,variable)) + 
  geom_tile(aes(fill = value)) + 
  theme(axis.text.x = element_text(family = "Calibri", 
                                   size = 11,angle = 45, hjust = 1,color = as.factor(colors)))

ggplotly(pp)

如您所见,我根据panel类型使用多种颜色来为x轴名称着色。问题是当我使用ggplotly()时,它消失了。一种替代方法是根据面板的colors为xaxis名称着色。主要问题仍然是ggplotly()

0 个答案:

没有答案