Skip to content

Commit

Permalink
Fix explained variance figure
Browse files Browse the repository at this point in the history
  • Loading branch information
eurunuela committed May 16, 2022
1 parent e4cc27d commit 09aa092
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tedana/reporting/static_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,44 +379,44 @@ def pca_results(criteria, n_components, all_varex, io_generator):
# Vertical line depicting the optimal number of components given by AIC
plt.vlines(
n_components[0],
ymin=np.min(criteria),
ymax=np.max(criteria),
ymin=0,
ymax=1,
color="tab:blue",
linestyles="dashed",
label="AIC",
)
# Vertical line depicting the optimal number of components given by KIC
plt.vlines(
n_components[1],
ymin=np.min(criteria),
ymax=np.max(criteria),
ymin=0,
ymax=1,
color="tab:orange",
linestyles="dashed",
label="KIC",
)
# Vertical line depicting the optimal number of components given by MDL
plt.vlines(
n_components[2],
ymin=np.min(criteria),
ymax=np.max(criteria),
ymin=0,
ymax=1,
color="tab:green",
linestyles="dashed",
label="MDL",
)
# Vertical line depicting the optimal number of components for 90% variance explained
plt.vlines(
n_components[3],
ymin=np.min(criteria),
ymax=np.max(criteria),
ymin=0,
ymax=1,
color="tab:red",
linestyles="dashed",
label="90% varexp",
)
# Vertical line depicting the optimal number of components for 95% variance explained
plt.vlines(
n_components[4],
ymin=np.min(criteria),
ymax=np.max(criteria),
ymin=0,
ymax=1,
color="tab:purple",
linestyles="dashed",
label="95% varexp",
Expand All @@ -428,4 +428,5 @@ def pca_results(criteria, n_components, all_varex, io_generator):
plot_name = "pca_variance_explained.png"
pca_variance_explained_name = os.path.join(io_generator.out_dir, "figures", plot_name)
plt.savefig(pca_variance_explained_name)
breakpoint()
plt.close()

0 comments on commit 09aa092

Please sign in to comment.