@@ -143,11 +143,19 @@ def Repl_Scatterplot(Repl1,Repl2,GOI='None',Annot='none',NonT='none',Transp='non
143143 plt .text (.45 ,.15 ,'Corr (Pearson) = ' + str (round (CorrCoeffP * 1000 )/ 1000 ),transform = axes .transAxes ,\
144144 fontsize = 9 , color = 'blue' )
145145 plt .text (.45 ,.1 ,'Corr (Spearman) = ' + str (round (CorrCoeffS * 1000 )/ 1000 ),transform = axes .transAxes ,\
146- fontsize = 9 , color = 'blue' )
147- xmax = 1.05 * (max ([max (repl1_rest ),max (repl1_nonT )]))
148- ymax = 1.05 * (max ([max (repl2_rest ),max (repl2_nonT )]))
149- xmin = - 0.1 * (max ([max (repl1_rest ),max (repl1_nonT )]))
150- ymin = - 0.1 * (max ([max (repl2_rest ),max (repl2_nonT )]))
146+ fontsize = 9 , color = 'blue' )
147+ if len (repl1_nonT ) != 0 :
148+ xmin = - 0.1 * (max ([max (repl1_rest ),max (repl1_nonT )]))
149+ xmax = 1.05 * (max ([max (repl1_rest ),max (repl1_nonT )]))
150+ else :
151+ xmin = - 0.1 * max (repl1_rest )
152+ xmax = 1.05 * max (repl1_rest )
153+ if len (repl2_nonT ) != 0 :
154+ ymin = - 0.1 * (max ([max (repl2_rest ),max (repl2_nonT )]))
155+ ymax = 1.05 * (max ([max (repl2_rest ),max (repl2_nonT )]))
156+ else :
157+ ymin = - 0.1 * max (repl2_rest )
158+ ymax = 1.05 * max (repl2_rest )
151159 plt .xlim ([xmin ,xmax ]); plt .ylim ([ymin ,ymax ])
152160 plt .tick_params (labelsize = 13 )
153161 if annotate :
0 commit comments