code-style model_plot
@@ -490,38 +490,15 @@ def plot_model_comparison(result, sort=False, colors=None,
# Floating axes
if method == 'neg_riem_dist':
ytoptick = noise_upper + 0.1
- ax.set_yticks(np.arange(np.min(perf), ytoptick + 1e-6, step=0.1))
- ax.spines['right'].set_visible(False)
- ax.spines['top'].set_visible(False)
- ax.set_xticks(np.arange(n_models))
- ax.spines['left'].set_bounds(np.min(perf), ytoptick)
- ax.spines['bottom'].set_bounds(0, n_models - 1)
- ax.yaxis.set_ticks_position('left')
- ax.xaxis.set_ticks_position('bottom')
- plt.rc('ytick', labelsize=fs2)
-
- # Axis labels
- y_label_string = _get_y_label(method)
- ylabel_fig_x, ysublabel_fig_x = 0.07, 0.095
- trans = transforms.blended_transform_factory(fig.transFigure,
- ax.get_yaxis_transform())
- ax.text(ylabel_fig_x, (np.min(perf)+ytoptick)/2, 'RDM prediction accuracy',
- horizontalalignment='center', verticalalignment='center',
- rotation='vertical', fontsize=fs, fontweight='bold',
- transform=trans)
- ax.text(ysublabel_fig_x, (np.min(perf)+ytoptick)/2,
- y_label_string,
- horizontalalignment='center', verticalalignment='center',
- rotation='vertical', fontsize=fs2, fontweight='normal',
- transform=trans)
-
+ ymin = np.min(perf)
else:
ytoptick = np.floor(min(1, noise_upper) * 10) / 10
- ax.set_yticks(np.arange(0, ytoptick + 1e-6, step=0.1))
+ ymin = 0
+ ax.set_yticks(np.arange(ymin, ytoptick + 1e-6, step=0.1))
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.set_xticks(np.arange(n_models))
- ax.spines['left'].set_bounds(0, ytoptick)
+ ax.spines['left'].set_bounds(np.min(perf), ytoptick)
ax.spines['bottom'].set_bounds(0, n_models - 1)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
@@ -532,11 +509,11 @@ def plot_model_comparison(result, sort=False, colors=None,
ylabel_fig_x, ysublabel_fig_x = 0.07, 0.095
trans = transforms.blended_transform_factory(fig.transFigure,
ax.get_yaxis_transform())
- ax.text(ylabel_fig_x, ytoptick/2, 'RDM prediction accuracy',
+ ax.text(ylabel_fig_x, (ymin + ytoptick) / 2, 'RDM prediction accuracy',
horizontalalignment='center', verticalalignment='center',
rotation='vertical', fontsize=fs, fontweight='bold',
transform=trans)
- ax.text(ysublabel_fig_x, ytoptick/2,
+ ax.text(ysublabel_fig_x, (ymin+ytoptick)/2,
y_label_string,
horizontalalignment='center', verticalalignment='center',
rotation='vertical', fontsize=fs2, fontweight='normal',
