Why the rectangle still out of picture when coord_cartesian(clip = "off")
All_genes_to_check_plot<- DotPlot(sce, features = All_genes_to_check, assay='RNA' ,group.by = 'seurat_clusters', dot.scale = 7) + scale_color_gradient2(low = "lightgrey", mid = "white", high = "black", midpoint = 0)+ ggtitle("")+ coord_cartesian(clip = "off")+ coord_flip()+ theme(legend.text = element_text(size = 8), legend.title = element_text(size = 10), axis.text = element_text(size = 10), #axis.text = element_blank(), # 隐藏坐标轴文本 #axis.ticks = element_blank(), # 隐藏坐标轴刻度 # axis.line = element_blank(), axis.title.x = element_blank(), # 去掉X轴标题 axis.title.y = element_blank()) # 隐藏坐标轴线
print(All_genes_to_check_plot) color_manual <- c("ExN" = "#8D7DBF","IM" ="#66AEA5" ,"NPC"="#bf253e","IP"="#E18D89","InN"="#EDA629") annoRect(object = All_genes_to_check_plot, annoPos = 'right', annoManual = T, yPosition = list(c(0.5,3.5,4.5,5.5,8.5), c(3.5,4.5,5.5,8.5,9.5)), xPosition = c(10.6,11), rectWidth = 6, pFill = c("#bf253e","#E18D89","#66AEA5","#EDA62e","#8D7DBF"), pCol = c("#bf253e","#E18D89","#66AEA5","#EDA62e","#8D7DBF"),
addText = T,
textLabel = c("NPC","IP","IM","InN","ExN"),
textRot = 0,
textHVjust = -0.2,
textSize = 7
##########################################
我在画图的时候添加 了coord_cartesian(clip = "off"),但是在添加注释时,发现还是超出坐标轴就看不见了,请大佬看看,谢谢。
也尝试了coord_cartesian(xlim = c(0, 15),ylim = c(0, 15),clip = "off")+,也没成功。