From 889f32c0615e8123458815ee999239f118e4af93 Mon Sep 17 00:00:00 2001
From: Dmitry Yurov <d.yurov@fz-juelich.de>
Date: Mon, 12 Feb 2018 14:32:55 +0100
Subject: [PATCH] Remove different y-axis limits in the case of log/linear
 switch

Redmine: #1936
---
 GUI/coregui/Models/SpecularDataItem.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/GUI/coregui/Models/SpecularDataItem.cpp b/GUI/coregui/Models/SpecularDataItem.cpp
index dc13a2a943c..756f4093767 100644
--- a/GUI/coregui/Models/SpecularDataItem.cpp
+++ b/GUI/coregui/Models/SpecularDataItem.cpp
@@ -249,12 +249,12 @@ QPair<double, double> SpecularDataItem::dataRange() const
     const OutputData<double>* data = getOutputData();
     double min(*std::min_element(data->begin(), data->end()));
     double max(*std::max_element(data->begin(), data->end()));
-    if (isLog()) {
-        min /= 2.0;
-        max *= 2.0;
-    } else {
-        max = max * 1.1;
-    }
+
+    // log y-axis is assumed by default no dependence in axis limits on log/linear mode provides
+    // uniform and expected behaviour both in the case of zoomed plot and in the case of
+    // default plot layout
+    min /= 2.0;
+    max *= 2.0;
 
     return QPair<double, double>(min, max);
 }
-- 
GitLab