From 8299cea4bfca57201336227cd3b1d2c99604c599 Mon Sep 17 00:00:00 2001 From: Giacomo Strangolino <giacomo.strangolino@elettra.eu> Date: Wed, 24 Mar 2021 15:41:50 +0100 Subject: [PATCH] first implementation of legend --- src/i0mmonplot.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i0mmonplot.cpp b/src/i0mmonplot.cpp index 750dafc..1ce9b96 100644 --- a/src/i0mmonplot.cpp +++ b/src/i0mmonplot.cpp @@ -68,6 +68,7 @@ void I0MMonPlot::setSources(const QString &x, const QString &y, const QMap<int, m_lambdas = lambdamap; m_time_mode = (x == "time"); m_reset_scales(); + int la = 1; foreach(double l, lambdamap.values()) { QString cuna = QString("lambda %1").arg(l); QuPlotCurve *crv = curve(cuna); @@ -77,6 +78,7 @@ void I0MMonPlot::setSources(const QString &x, const QString &y, const QMap<int, QPen p = crv->pen(); p.setWidthF(2.5); crv->setPen(p); + crv->setTitle(QString("λ %1").arg(la++)); } m_curvesymap[cuna] = m_symstyles[m_curvesymap.size() % m_symstyles.size()]; } -- GitLab