diff --git a/src/dualplot.cpp b/src/dualplot.cpp
index 3e47676e4755eec3915e71e3da4bc9ae229d476d..fa34021e8f8eaa089edbd04682165078fedbb044 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 d7ff6084556692e41dc1eade52a4ada8b9610ed0..c8e4ebb4a69107072e777d4b5c9e65ab247ca7be 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;