First, adjust the data you want to plot into a format that can be recognized by the R language. It is recommended that you save it in csv format in excel.
datastructure:
data<-read.csv("your file path", header = T)
header=T
means that the first row in the data is the column name, if there is no column name, use header=F
library(reshape2)
library(ggplot2)
data_melt<-melt (data)
names(data_melt) = c('Gene', 'Cell', 'Value')
p<-ggplot(data_melt, aes(x = Gene, y = Cell, size = Value, color=Cell)) + geom_point()
melt()
function turns the wide data in the table into long datap<-ggplot(data_melt, aes(x = Gene, y = Cell, size = Value, color=Cell)) + geom_point()+
theme(panel.background = element_blank(),
panel.grid.major = element_line(colour = "gray"),
panel.border = element_rect(colour="black",fill=NA))
panel.background = element_blank()
: chanage original gray background to transparentpanel.grid.major = element_line(colour = "gray")
: change color of grid lines to be graypanel.border = element_rect(colour="black",fill=NA)
: change border color to black