From b0a959c591ee5724bdccde10048a501476495471 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 9 Sep 2022 13:57:47 +0200 Subject: [PATCH] #9280 Fix missing horizontal error bars * #9280 Fix missing horizontal error bars. The x axis was not assigned properly for the error bars in the plot curve. * Propagate error bar visibility state --- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 1 + ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index fceb6b76cb..34b2c43dac 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -513,6 +513,7 @@ void RimWellRftPlot::updateCurvesInPlot( const std::setsetErrorBarsVisible( m_showErrorInObservedData ); plotTrack->addCurve( curve ); auto observedFmuRftData = curveDefToAdd.address().observedFmuRftData(); diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp index 6f1e70382e..a11389de8b 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp @@ -492,7 +492,12 @@ void RiuQwtPlotCurve::setSamplesFromXYErrorValues( const std::vector& //-------------------------------------------------------------------------------------------------- void RiuQwtPlotCurve::setXAxis( RiuPlotAxis axis ) { - if ( m_plotWidget ) QwtPlotCurve::setXAxis( m_plotWidget->toQwtPlotAxis( axis ) ); + if ( m_plotWidget ) + { + auto axisId = m_plotWidget->toQwtPlotAxis( axis ); + QwtPlotCurve::setXAxis( axisId ); + if ( m_qwtCurveErrorBars ) m_qwtCurveErrorBars->setXAxis( axisId ); + } } //--------------------------------------------------------------------------------------------------