Dotplot : how to self-define the range of legend
1
0
Entering edit mode
9 months ago
Xuhao • 0

Hi everyone, The default range of the Percent Expressed legend ranges from "20" "40" "60" (as shown in the figure), how can I change it to "0 25 50 75 100"?enter image description here

DotPlot(mrc.har_sub, features = markers.to.plot , dot.scale = 10) + RotatedAxis() + 
  theme(axis.text.x = element_text(angle = 45, hjust=1, size= 8), axis.text.y = element_text(size = 8)) + 
  scale_colour_gradientn(colours = pal)+ theme(legend.position="right", legend.text = element_text(size = 8),legend.title = element_text(size = 8))  + 
  labs(title = "Differentiated markers", y = "", x="") + theme(plot.title = element_text(size=10))
analysis seq RNA • 797 views
ADD COMMENT
2
Entering edit mode
9 months ago
zau saa ▴ 120

add scale_size_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100))

DotPlot(mrc.har_sub, features = markers.to.plot , dot.scale = 10) + RotatedAxis() + theme(axis.text.x = element_text(angle = 45, hjust=1, size= 8), axis.text.y = element_text(size = 8)) + scale_colour_gradientn(colours = pal)+ theme(legend.position="right", legend.text = element_text(size = 8),legend.title = element_text(size = 8)) + labs(title = "Differentiated markers", y = "", x="") + theme(plot.title = element_text(size=10)) + scale_size_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100))

ADD COMMENT
0
Entering edit mode

It works!!! Thanks so much. Can I ask one more question? How to change the "average expression" scale into "-1, -0.5, 0, 0.5, 1"?

ADD REPLY
1
Entering edit mode

add breaks = c(-1, -0.5, 0, 0.5, 1) to scale_colour_gradientn()

ADD REPLY
0
Entering edit mode

Thanks for your kind help.

ADD REPLY

Login before adding your answer.

Traffic: 3559 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6