From 5557eca0c7b914217451c2e5b34ed916fc65f59f Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (home)" <j.wuttke@fz-juelich.de>
Date: Sun, 15 Mar 2009 16:22:41 +0100
Subject: [PATCH] c log y lim

---
 src/dualplot.cpp | 4 ++++
 src/edif.cpp     | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/dualplot.cpp b/src/dualplot.cpp
index 3e47676e..fa34021e 100644
--- a/src/dualplot.cpp
+++ b/src/dualplot.cpp
@@ -420,6 +420,8 @@ void NPlot::Box()
     double *tack, ticklim[2];
 
     ps_accu.push_back( "\n/xPlotFrame {" );
+    if ( X.log && X.R.inf<= 0 )
+        throw "BUG: x log incompatible with limits " + X.R.str();
     plotaux::calc_ticks( X.log, X.R.inf, X.R.sup, 
                          &ntack, &tack, &ntpt, ticklim );
     ps_ticktack(ntack, tack, ntpt, ticklim, &X);
@@ -435,6 +437,8 @@ void NPlot::Box()
     ps_accu.push_back( "} def\n" );
     
     ps_accu.push_back( "\n/yPlotFrame {" );
+    if ( Y.log && Y.R.inf<= 0 )
+        throw "BUG: y log incompatible with limits " + Y.R.str();
     plotaux::calc_ticks( Y.log, Y.R.inf, Y.R.sup, 
                          &ntack, &tack, &ntpt, ticklim );
     ps_ticktack(ntack, tack, ntpt, ticklim, &Y);
diff --git a/src/edif.cpp b/src/edif.cpp
index d7ff6084..c8e4ebb4 100644
--- a/src/edif.cpp
+++ b/src/edif.cpp
@@ -996,6 +996,8 @@ void NEdif::Plot( bool add )
                     bool first=true;
                     for (uint i=0; i<S->size(); i++) {
                         // if (!xsubrange.contained(x[i])) continue;
+                        if( NPlot::Y.log && S->y[i]<=0 )
+                            continue;
                         if (first) {
                             inf=S->y[i], sup=S->y[i];
                             first = false;
-- 
GitLab