always include reference column in correlation plot
@@ -708,7 +708,6 @@ def confounds_correlation_plot(confounds_file, output_file=None, figure=None,
confounds_data = confounds_data.loc[:, np.logical_not(
np.isclose(confounds_data.var(skipna=True), 0))]
corr = confounds_data.corr()
- np.fill_diagonal(corr.values, 0)
gscorr = corr.copy()
gscorr['index'] = gscorr.index
@@ -721,6 +720,7 @@ def confounds_correlation_plot(confounds_file, output_file=None, figure=None,
features = [p for p in corr.columns if p in gs_descending]
corr = corr.loc[features, features]
n_vars = corr.shape[0]
+ np.fill_diagonal(corr.values, 0)
if figure is None:
plt.figure(figsize=(3*n_vars*0.3, n_vars*0.3))
