@@ -1758,9 +1758,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None):
1758
1758
markerfacecolor = facecolor , markeredgecolor = color ,
1759
1759
markersize = markersize )
1760
1760
1761
+ ax .set_xticks (numpy .arange (len (results_t )))
1761
1762
ax .set_xticklabels ([res .sim_name [0 ] for res in results_t ],
1762
1763
rotation = xticklabels_rotation , fontsize = xlabel_fontsize )
1763
- ax .set_xticks (numpy .arange (len (results_t )))
1764
1764
ax .set_xlabel (xlabel )
1765
1765
ax .set_ylabel (ylabel , fontsize = ylabel_fontsize )
1766
1766
ax .set_title (title )
@@ -1769,8 +1769,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None):
1769
1769
ax .yaxis .set_major_locator (matplotlib .ticker .MaxNLocator (integer = True ))
1770
1770
ax .set_ylim ([ylim [0 ], ylim [1 ]])
1771
1771
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 )
1774
1775
fig .tight_layout ()
1775
1776
1776
1777
return ax
0 commit comments