Multiple axis.text.x names coloring does not work with ggplotly()

瘦欲@ 提交于 2019-12-13 14:24:58

问题


I have a data frame:

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"))

And I create a heatmap with:

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)

As you can see I use multiple colours according to the panel type to color the x-axis names. The problem is that when I use ggplotly() this disappears. An alternative would be to color the xaxis names according to the colors instaed of panel. The main issue is still ggplotly()

来源:https://stackoverflow.com/questions/51538933/multiple-axis-text-x-names-coloring-does-not-work-with-ggplotly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!