Skip to content

Commit 7b03322

Browse files
committed
updating image to have consistent X range
1 parent fa7df08 commit 7b03322

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Here we show the image histograms (from mricron) for:
1515

1616
2) and 3) have truncation of the distributions. For both 3) and 4) it was also necessary to convert p-values exactly == 1 to 0.999999, as a value of exactly 1 will be converted to inf when converted to the standard normal score.
1717

18-
Note that the y-axis scale for the second image, 3dcalc, extends to a density of 2.0 due to the number of zeros that are replaced to prevent error. We chose a consistent y-axis scale up to 0.8 for the other images, otherwise we would not be able to see the distributions.
18+
Note that the y-axis scales are slightly different, most noticably for the second image, 3dcalc, which extends to a density of 2.0 due to the number of zeros that are replaced to prevent error.
1919

2020
# Installation
2121

doc/histograms.png

-55.5 KB
Loading

doc/make_histograms.R

+8-7
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ map_types = c("t-stat map","z-stat map","z-stat map","z-stat map")
3232

3333
# Make the ggplots
3434

35-
make_plot = function(df,color,image_name,map_type){
36-
return(ggplot(df,aes(x=value, fill=color)) +
35+
make_plot = function(df,n,image_name,map_type){
36+
return(ggplot(df,aes(x=value, fill=colors[n])) +
3737
geom_density(alpha=0.25,binwidth=1) +
3838
theme(legend.position="none") +
39+
xlim(-67,37) +
3940
xlab(paste(image_name,map_type)) +
4041
guides(fill=FALSE))
4142
}
4243

43-
plot1 = make_plot(data[[1]],colors[1],names(data[1]),map_types[1])
44-
plot2 = make_plot(data[[2]],colors[2],names(data[2]),map_types[2])
45-
plot3 = make_plot(data[[3]],colors[3],names(data[3]),map_types[3])
46-
plot4 = make_plot(data[[4]],colors[4],names(data[4]),map_types[4])
44+
plot1 = make_plot(data[[1]],n,names(data[1]),map_types[1])
45+
plot2 = make_plot(data[[2]],n,names(data[2]),map_types[2])
46+
plot3 = make_plot(data[[3]],n,names(data[3]),map_types[3])
47+
plot4 = make_plot(data[[4]],n,names(data[4]),map_types[4])
4748
g = arrangeGrob(plot1,plot2,plot3,plot4,ncol=4)
48-
ggsave(file="new_histograms.png",g)
49+
ggsave(file="histograms.png",g)
4950

0 commit comments

Comments
 (0)