ggplot does not plot the values of the plot with new data

This works for me. Are you loading in your two dataframes from separate .csv files?

library(ggplot2)
library(wesanderson)

d <- sample.data #From your googledrive

pal <- wes_palette("Zissou1", 50, type = "continuous")
m <-ggplot (data=d)+
  geom_tile(aes(x=Combination, y=Drug_dose, fill=Avg.percent))+
  geom_text(aes(x=Combination, y=Drug_dose,label=Avg.percent), size=3)+
  scale_fill_gradientn(colors=pal)+
  theme(legend.text = element_text(size=10, face="bold", color = "black"))+
  theme(axis.text.x = element_text(size = 15,  face="bold", color = "black")) +
  theme(axis.text.y = element_text(size = 9,  face="bold", color = "black")) +
  theme(axis.title.x = element_text(size = 15,  face="bold", color = "black", vjust = 3))+
  theme(axis.title.y = element_text(size = 15,  face="bold", color = "black", hjust = 0.5))+
  theme(plot.title = element_text(size = 16))+
  theme(strip.text.y  = element_text(size = 10, face = "bold", color = "black"))+
  scale_x_discrete(position ="top") +
  xlab("Combination added")+
  ylab("Treatments in the screen")+
  ggtitle("Cluster 1 Enriched in PDB response")
m

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top