@@ -14,10 +14,15 @@ def plot_evalution_result(results,
1414                          titles ,
1515                          output_path ,
1616                          legend_in_which_subplot = 1 ,
17-                           layout = (2 , 2 )):
17+                           layout = (2 , 2 ),
18+                           figure_size = (None , None )):
1819    """ 
1920    subplots across different dataset 
2021    """ 
22+     if  figure_size [0 ] and  figure_size [1 ]:
23+         from  pylab  import  rcParams 
24+         rcParams ['figure.figsize' ] =  figure_size 
25+ 
2126    output_dir = os .path .dirname (output_path )
2227    if  not  os .path .exists (output_dir ):
2328        os .makedirs (output_dir )
@@ -61,6 +66,8 @@ def main():
6166    parser .add_argument ('--legend_in_which_subplot' , type = int )
6267    parser .add_argument ('--ncols' , type = int , default = 2 )
6368    parser .add_argument ('--nrows' , type = int , default = 2 )
69+     parser .add_argument ('--figure_height' , type = int )
70+     parser .add_argument ('--figure_width' , type = int )
6471    parser .add_argument ('--output_path' )
6572
6673    args  =  parser .parse_args ()
@@ -75,7 +82,8 @@ def main():
7582        titles = args .titles ,
7683        output_path = args .output_path ,
7784        legend_in_which_subplot = args .legend_in_which_subplot ,
78-         layout = (args .nrows , args .ncols )
85+         layout = (args .nrows , args .ncols ),
86+         figure_size = (args .figure_width , args .figure_height )
7987    )
8088
8189if  __name__  ==  '__main__' :
0 commit comments