@@ -57,21 +57,25 @@ def plot_intensity_thresholds(input_dir, output_dir, cochlea, plot=False, sharex
5757 if cochlea in CUSTOM_THRESHOLDS and stain in CUSTOM_THRESHOLDS [cochlea ]:
5858 rows = 2
5959 row_types = ["threshold" , "custom" ]
60+ columns = number_plots
6061 if custom_only :
61- rows = 1
62+ rows = 2
6263 row_types = ["custom" ]
64+ columns = number_plots // 2
65+
6366 else :
6467 rows = 1
6568 row_types = ["threshold" ]
69+ columns = number_plots
6670
67- columns = number_plots
68- fig , axes = plt .subplots (rows , columns , figsize = (columns * 4 , rows * 4 ), sharex = sharex )
71+ main_label_size = 20
72+ main_tick_size = 16
73+ fig , axes = plt .subplots (rows , columns , figsize = (columns * 2.5 , rows * 2.5 ), sharex = sharex )
6974 ax = axes .flatten ()
7075 table_path_s3 , fs = get_s3_path (table_measurement_path )
7176 with fs .open (table_path_s3 , "r" ) as f :
7277 table_measurement = pd .read_csv (f , sep = "\t " )
7378
74- alias = ALIAS [cochlea ]
7579 for enum , row_type in enumerate (row_types ):
7680 if row_type == "threshold" :
7781 for num , center_str in enumerate (center_strs ):
@@ -88,8 +92,8 @@ def plot_intensity_thresholds(input_dir, output_dir, cochlea, plot=False, sharex
8892
8993 ax [enum * columns + num ].hist (pos_values , bins = bins , alpha = 0.6 , label = 'Positive' , color = 'tab:blue' )
9094 ax [enum * columns + num ].hist (neg_values , bins = bins , alpha = 0.6 , label = 'Negative' , color = 'tab:orange' )
91- ax [enum * columns + num ].set_ylabel ('Count' )
92- ax [enum * columns + num ].set_xlabel ('Intensity' )
95+ ax [enum * columns + num ].set_ylabel ('Count' , fontsize = main_label_size )
96+ ax [enum * columns + num ].set_xlabel ('Intensity' , fontsize = main_label_size )
9397 ax [enum * columns + num ].legend ()
9498 if title_type == "center_str" :
9599 ax [enum * columns + num ].set_title (center_str )
@@ -116,16 +120,18 @@ def plot_intensity_thresholds(input_dir, output_dir, cochlea, plot=False, sharex
116120 label = 'Positive' , color = 'tab:blue' )
117121 ax [enum * columns + num ].hist (neg_values , bins = bins , alpha = 0.6 ,
118122 label = 'Negative' , color = 'tab:orange' )
119- ax [enum * columns + num ].set_ylabel ('Count' )
120- ax [enum * columns + num ].set_xlabel ('Intensity' )
123+ ax [enum * columns + num ].set_ylabel ('Count' , fontsize = main_label_size )
124+ ax [enum * columns + num ].set_xlabel ('Intensity' , fontsize = main_label_size )
125+ ax [enum * columns + num ].tick_params (axis = 'x' , labelsize = main_tick_size )
126+ ax [enum * columns + num ].tick_params (axis = 'y' , labelsize = main_tick_size )
121127 ax [enum * columns + num ].legend ()
122128 if title_type == "center_str" :
123- ax [enum * columns + num ].set_title (center_str )
129+ ax [enum * columns + num ].set_title (center_str , fontsize = main_label_size )
124130 else :
125131 ax [enum * columns + num ].set_title (f"Crop { str (num + 1 ).zfill (1 )} " )
126132
133+ alias = ALIAS [cochlea ]
127134 fig .suptitle (f"{ alias } - { stain } " , fontsize = 30 )
128-
129135 plt .tight_layout ()
130136
131137 if ".png" in save_path :
0 commit comments