我正在尝试创建一个热图ggplot2(你看到下面的代码)现在有两件事我想改变:
我想在图例中显示超过6个值.我尝试了例如休息,标签,但这不起作用
(p <- ggplot(dataPVal.m, aes(variable, structure)) +
geom_tile(aes(fill = pValue), colour = "white") +
scale_colour_gradientn(colour = rainbow(100), breaks = c(1,2,3,4,5,6), labels =c("a","b","c","d","e","f")) +
theme_grey(base_size = base_size) +
labs(x = "position (0=seed start)",y = "structure") + ## labels
#scale_x_discrete(expand = c(0.01, 0.01)) + ## grauer rand oben/unten
#scale_y_discrete(expand = c(0.01, 0.01)) + ## grauer rand links/rechts
opts(title=plot_title,legend.position = "left",axis.ticks = theme_blank(), axis.text.x = theme_text(size = base_size * 0.8, angle = 330, hjust = 0, colour = …Run Code Online (Sandbox Code Playgroud)