diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp index 3c6b7f6b4a..95738dd12f 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp @@ -594,6 +594,13 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate() // Hide legend display for curves other than the first showLegendInQwt = false; } + else + { + if (ensembleCurveSet->colorMode() == RimEnsembleCurveSet::BY_ENSEMBLE_PARAM) + { + showLegendInQwt = false; + } + } } else { @@ -608,8 +615,7 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate() showLegendInQwt = false; } } - } - + m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt); } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 8a4a1611dd..8ccfc56e4d 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -328,6 +328,14 @@ RimSummaryCaseCollection* RimEnsembleCurveSet::summaryCaseCollection() const return m_yValuesSummaryGroup(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleCurveSet::ColorMode RimEnsembleCurveSet::colorMode() const +{ + return m_colorMode(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -642,6 +650,11 @@ void RimEnsembleCurveSet::updateCurveColors() } plot->qwtPlot()->replot(); } + + if (firstCurve()) + { + firstCurve()->updateLegendEntryVisibilityAndPlotLegend(); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 802de95035..685791cc39 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -84,6 +84,8 @@ public: void setSummaryCaseCollection(RimSummaryCaseCollection* sumCaseCollection); RimSummaryCaseCollection* summaryCaseCollection() const; + ColorMode colorMode() const; + private: caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField();