diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp index d14443fa7d..cfcb2bd375 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp @@ -161,6 +161,14 @@ void RimWellLogPlotTrace::loadDataAndUpdate() { CVF_ASSERT(m_viewer); + RimWellLogPlot* wellLogPlot; + firstAnchestorOrThisOfType(wellLogPlot); + if (wellLogPlot) + { + QString depthTitle = wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH ? "MD" : "TVD"; + m_viewer->setDepthTitle(depthTitle); + } + for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx) { curves[cIdx]->updatePlotData(); diff --git a/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp b/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp index fdf04c6304..33c4e4f0ae 100644 --- a/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp @@ -26,6 +26,8 @@ #include "qwt_legend.h" #include "qwt_scale_engine.h" #include "qwt_plot_layout.h" +#include "qwt_scale_draw.h" +#include "qwt_text.h" #include #include @@ -109,6 +111,13 @@ void RiuWellLogTracePlot::setDefaults() QFont yAxisFont = axisFont(QwtPlot::yLeft); yAxisFont.setPixelSize(9); setAxisFont(QwtPlot::yLeft, yAxisFont); + + QwtText axisTitleY = axisTitle(QwtPlot::yLeft); + QFont yAxisTitleFont = axisTitleY.font(); + yAxisTitleFont.setPixelSize(12); + axisTitleY.setFont(yAxisTitleFont); + axisTitleY.setRenderFlags(Qt::AlignRight); + setAxisTitle(QwtPlot::yLeft, axisTitleY); } //-------------------------------------------------------------------------------------------------- @@ -121,6 +130,16 @@ void RiuWellLogTracePlot::setDepthRange(double minDepth, double maxDepth) //replot(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuWellLogTracePlot::setDepthTitle(const QString& title) +{ + QwtText axisTitleY = axisTitle(QwtPlot::yLeft); + axisTitleY.setText(title); + setAxisTitle(QwtPlot::yLeft, axisTitleY); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuWellLogTracePlot.h b/ApplicationCode/UserInterface/RiuWellLogTracePlot.h index ac9e63be57..f98a36cd03 100644 --- a/ApplicationCode/UserInterface/RiuWellLogTracePlot.h +++ b/ApplicationCode/UserInterface/RiuWellLogTracePlot.h @@ -41,6 +41,7 @@ public: virtual ~RiuWellLogTracePlot(); void setDepthRange(double minDepth, double maxDepth); + void setDepthTitle(const QString& title); protected: virtual bool eventFilter(QObject* watched, QEvent* event);