-
Notifications
You must be signed in to change notification settings - Fork 0
/
step_5th_showResults_Fig3b_scatter_BOLDFC_DSISC.R
56 lines (48 loc) · 2.48 KB
/
step_5th_showResults_Fig3b_scatter_BOLDFC_DSISC.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#initiate set
rm(list = ls())
setwd('E:/WMseegBoldFCanalysis/CorrelationAnalysis/Fig3_results2fig')
library('ggplot2')
library('R.matlab')
library('ggsci')
#
theme_niwot <- function(){
theme_bw() +
theme(text = element_text(family = "Arial"),
axis.line.x = element_line(color="black",size = 1.0),
axis.line.y = element_line(color="black",size = 1.0),
axis.ticks.x = element_line(color="black",size = 1.0),
axis.ticks.y = element_line(color="black",size = 1.0),
axis.text.x = element_text(family = "Arial",size=26, color = "black"),
axis.text.y = element_text(family = "Arial",size=26, color = "black"),
panel.border = element_blank(),
axis.title.x = element_text(margin = margin(t = 10),size=27,
family = "Arial",color="black", hjust = 0.5, vjust = 0.5),
axis.title.y = element_text(margin = margin(r = 10),size=27,
family = "Arial",color="black", hjust = 0.5, vjust = 0),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.text = element_text(size = 20,family ="Arial"),
legend.title = element_blank(),
legend.key = element_blank(),
panel.background = element_rect(fill = "white"),
legend.background = element_rect(color = "black",
fill = "transparent",size = 2, linetype = "blank"))
}
#main function
Data <- readMat('Fig3b.mat')
DsiSCboldFC = data.frame(DSISC = as.numeric(Data$Fig3b[1, 1:511]))
DsiSCboldFC$BOLDFC = as.numeric(Data$Fig3b[2, 1:511])
p <- ggplot(DsiSCboldFC, aes(DSISC, BOLDFC)) +
geom_point(color="gray78", size=2) +
labs(x = "log(SC)", y = "BOLD FC") +
geom_smooth(color = 'black', formula = y ~ x, fill = "gray78", method = "lm", size=1) +
scale_x_continuous(breaks=seq(-1, 4, 1), labels = c(-1, 0, 1, 2, 3, 4), limits = c(-1.6,2.3)) +
scale_y_continuous(breaks=seq(-0.6, 0.9, 0.3), labels = c(-0.6, -0.3, 0, 0.3, 0.6, 0.9), limits = c(-0.7, 0.7)) +
scale_color_npg() +
scale_fill_npg() +
theme_niwot()
p
#save fig
ggsave("Fig3b_dsisc_boldfc.png", plot = p, dpi=300, width = 6.2, height = 5.3)