From 2937cecbd15c66fdf2ccdbebb7d405646ea1fd84 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Sat, 28 Jan 2023 15:27:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20SVD=20vector=20labels=20al?= =?UTF-8?q?ways=20starting=20from=20zero?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyglotaran_extras/plotting/plot_svd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyglotaran_extras/plotting/plot_svd.py b/pyglotaran_extras/plotting/plot_svd.py index f650ff43..6fc44479 100644 --- a/pyglotaran_extras/plotting/plot_svd.py +++ b/pyglotaran_extras/plotting/plot_svd.py @@ -338,7 +338,7 @@ def _plot_svd_vectors( if x_dim == sv_index_dim: values = values.T x_dim = vector_data.dims[0] - for index, (zorder, value) in enumerate(zip(range(100)[::-1], values)): - value.plot.line(x=x_dim, ax=ax, zorder=zorder, label=index) + for zorder, label, value in zip(range(100)[::-1], indices[:max_index], values): + value.plot.line(x=x_dim, ax=ax, zorder=zorder, label=label) if show_legend is True: ax.legend(title=sv_index_dim)