Skip to content

Commit

Permalink
Merge pull request #554 from Quentin62/fpcaplot
Browse files Browse the repository at this point in the history
fix IndexError in FPCAPlot
  • Loading branch information
vnmabus committed Jul 6, 2023
2 parents 48fb0ad + 4a56dd7 commit 415796b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions skfda/exploratory/visualization/fpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ def _plot(
self.mean = self.mean.mean()

for i, ax in enumerate(axes):
perturbations = self._get_component_perturbations(i)
GraphPlot(fdata=perturbations, axes=ax).plot()
ax.set_title(f"Principal component {i + 1}")
if i < self.n_subplots:
perturbations = self._get_component_perturbations(i)
GraphPlot(fdata=perturbations, axes=ax).plot()
ax.set_title(f"Principal component {i + 1}")

def _get_component_perturbations(self, index: int = 0) -> FData:
"""
Expand Down

0 comments on commit 415796b

Please sign in to comment.