diff --git a/MantidPlot/CMakeLists.txt b/MantidPlot/CMakeLists.txt
index a1d7876115902434aa4bfc02ade405afdc709dc2..99cdbb032a740aa3c21ae7d47587c259ad59f1c6 100644
--- a/MantidPlot/CMakeLists.txt
+++ b/MantidPlot/CMakeLists.txt
@@ -174,6 +174,7 @@ set ( MANTID_SRCS  src/Mantid/AlgorithmDockWidget.cpp
                    src/Mantid/MantidAbout.cpp
                    src/Mantid/MantidApplication.cpp
                    src/Mantid/MantidCurve.cpp
+                   src/Mantid/MantidGroupPlotGenerator.cpp
                    src/Mantid/MantidMatrix.cpp
                    src/Mantid/MantidMatrixCurve.cpp
 		   src/Mantid/MantidMatrixDxExtensionHandler.cpp
@@ -183,9 +184,9 @@ set ( MANTID_SRCS  src/Mantid/AlgorithmDockWidget.cpp
                    src/Mantid/MantidMDCurve.cpp
                    src/Mantid/MantidMDCurveDialog.cpp
                    src/Mantid/MantidMatrixDialog.cpp
+                   src/Mantid/MantidPlotUtilities.cpp
                    src/Mantid/MantidSampleLogDialog.cpp
                    src/Mantid/MantidSampleMaterialDialog.cpp
-				   src/Mantid/MantidGroupPlotGenerator.cpp
                    src/Mantid/MantidUI.cpp
                    src/Mantid/MantidTable.cpp
                    src/Mantid/PeakPickerTool.cpp
@@ -372,12 +373,13 @@ set ( MANTID_HDRS  src/Mantid/AlgorithmMonitor.h
 		   src/Mantid/MantidMatrixTabExtension.h
                    src/Mantid/MantidMDCurve.h
                    src/Mantid/MantidMDCurveDialog.h
+		   src/Mantid/MantidGroupPlotGenerator.h
                    src/Mantid/MantidMatrixDialog.h
                    src/Mantid/MantidMatrix.h
                    src/Mantid/MantidMatrixFunction.h
+                   src/Mantid/MantidPlotUtilities.h
                    src/Mantid/MantidSampleLogDialog.h
                    src/Mantid/MantidSampleMaterialDialog.h
-				   src/Mantid/MantidGroupPlotGenerator.h
                    src/Mantid/MantidUI.h
                    src/Mantid/MantidTable.h
                    src/Mantid/PeakPickerTool.h
diff --git a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
index bd19bae7fe503921dc5093e5a3e55b99d173d0c3..560b52fe20572774a085671505b7e2d1ea3cbf72 100644
--- a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
+++ b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
@@ -4,6 +4,7 @@
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
+#include "MantidPlotUtilities.h"
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 #include <MantidQtMantidWidgets/MantidDisplayBase.h>
 
@@ -220,7 +221,10 @@ double MantidGroupPlotGenerator::getSingleLogValue(
 double MantidGroupPlotGenerator::getSingleLogValue(
     int wsIndex, const Mantid::API::MatrixWorkspace_const_sptr &matrixWS,
     const QString &logName) const {
-  if (logName == MantidWSIndexWidget::WORKSPACE_INDEX) {
+
+    return getSingleWorkspaceLogValue(wsIndex, matrixWS, logName );
+
+/*  if (logName == MantidWSIndexWidget::WORKSPACE_INDEX) {
     return wsIndex;
   } else {
     // MatrixWorkspace is an ExperimentInfo
@@ -240,7 +244,7 @@ double MantidGroupPlotGenerator::getSingleLogValue(
     } else {
       throw std::invalid_argument("Bad input workspace type");
     }
-  }
+  } */
 }
 
 /**
diff --git a/MantidPlot/src/Mantid/MantidPlotUtilities.cpp b/MantidPlot/src/Mantid/MantidPlotUtilities.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..89c420a203beffa8be2f76e6dd0b4731fde3680f
--- /dev/null
+++ b/MantidPlot/src/Mantid/MantidPlotUtilities.cpp
@@ -0,0 +1,55 @@
+#include "MantidPlotUtilities.h"
+
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidAPI/WorkspaceGroup.h"
+#include "MantidGeometry/MDGeometry/IMDDimension.h"
+#include <MantidQtMantidWidgets/MantidDisplayBase.h>
+
+using namespace MantidQt::MantidWidgets;
+using Mantid::API::WorkspaceGroup_const_sptr;
+using Mantid::API::WorkspaceGroup_sptr;
+using Mantid::API::MatrixWorkspace_const_sptr;
+using Mantid::API::MatrixWorkspace_sptr;
+using Mantid::API::MatrixWorkspace;
+using Mantid::API::ExperimentInfo;
+using Mantid::HistogramData::Histogram;
+
+
+
+/**
+ * Gets the given log value from the given workspace as a double.
+ * Should be a single-valued log!
+ * @param wsIndex :: [input] Index of workspace in group
+ * @param matrixWS :: [input] Workspace to find log from
+ * @param logName :: [input] Name of log
+ * @returns log value as a double, or workspace index
+ * @throws invalid_argument if log is wrong type or not present
+ */
+double getSingleWorkspaceLogValue(
+    int wsIndex, const Mantid::API::MatrixWorkspace_const_sptr &matrixWS,
+    const QString &logName) {
+  if (logName == MantidWSIndexWidget::WORKSPACE_INDEX) {
+    return wsIndex;
+  } else {
+    // MatrixWorkspace is an ExperimentInfo
+    if (auto ei = boost::dynamic_pointer_cast<const ExperimentInfo>(matrixWS)) {
+      auto log = ei->run().getLogData(logName.toStdString());
+      if (log) {
+        if (dynamic_cast<Mantid::Kernel::PropertyWithValue<int> *>(log) ||
+            dynamic_cast<Mantid::Kernel::PropertyWithValue<double> *>(log)) {
+          return std::stod(log->value());
+        } else {
+          throw std::invalid_argument(
+              "Log is of wrong type (expected single numeric value");
+        }
+      } else {
+        throw std::invalid_argument("Log not present in workspace");
+      }
+    } else {
+      throw std::invalid_argument("Bad input workspace type");
+    }
+  }
+}
+
diff --git a/MantidPlot/src/Mantid/MantidPlotUtilities.h b/MantidPlot/src/Mantid/MantidPlotUtilities.h
new file mode 100644
index 0000000000000000000000000000000000000000..2a1d3d3e5b786b4f88e893631093003835bfab13
--- /dev/null
+++ b/MantidPlot/src/Mantid/MantidPlotUtilities.h
@@ -0,0 +1,19 @@
+#ifndef MANTIDPLOTUTILITIES_H_
+#define MANTIDPLOTUTILITIES_H_
+
+#include "MantidQtMantidWidgets/MantidWSIndexDialog.h"
+
+
+/**
+* This utility class generates a surface or contour plot from a group of
+* workspaces.
+*/
+
+  /// Returns a single log value from the given workspace
+  double
+  getSingleWorkspaceLogValue(int wsIndex,
+                    const Mantid::API::MatrixWorkspace_const_sptr &matrixWS,
+                    const QString &logName);
+
+
+#endif //MANTIDPLOTUTILITIES_H_