@@ -1758,9 +1758,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None):
17581758 markerfacecolor = facecolor , markeredgecolor = color ,
17591759 markersize = markersize )
17601760
1761+ ax .set_xticks (numpy .arange (len (results_t )))
17611762 ax .set_xticklabels ([res .sim_name [0 ] for res in results_t ],
17621763 rotation = xticklabels_rotation , fontsize = xlabel_fontsize )
1763- ax .set_xticks (numpy .arange (len (results_t )))
17641764 ax .set_xlabel (xlabel )
17651765 ax .set_ylabel (ylabel , fontsize = ylabel_fontsize )
17661766 ax .set_title (title )
@@ -1769,8 +1769,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None):
17691769 ax .yaxis .set_major_locator (matplotlib .ticker .MaxNLocator (integer = True ))
17701770 ax .set_ylim ([ylim [0 ], ylim [1 ]])
17711771 ax .set_xlim ([- 0.5 , len (results_t ) - 0.5 ])
1772- ax .bar (xTickPos , numpy .array ([9999 ] * len (xTickPos )), bottom = - 2000 ,
1773- width = (xTickPos [1 ] - xTickPos [0 ]), color = ['gray' , 'w' ], alpha = 0.2 )
1772+ if len (results_t ) > 2 :
1773+ ax .bar (xTickPos , numpy .array ([9999 ] * len (xTickPos )), bottom = - 2000 ,
1774+ width = (xTickPos [1 ] - xTickPos [0 ]), color = ['gray' , 'w' ], alpha = 0.2 )
17741775 fig .tight_layout ()
17751776
17761777 return ax
0 commit comments