diff --git a/notebooks/LPD/LPDChar_Darks_NBC.ipynb b/notebooks/LPD/LPDChar_Darks_NBC.ipynb
index 277d5231cc5b627733c378eeacefab5d952134ec..fcde6c8e460c59098f8c4303f5e6e674db4787e5 100644
--- a/notebooks/LPD/LPDChar_Darks_NBC.ipynb
+++ b/notebooks/LPD/LPDChar_Darks_NBC.ipynb
@@ -552,7 +552,11 @@
     "            offset = np.nanmedian(data)\n",
     "            noise = np.nanstd(data)\n",
     "            xrange = [np.nanmin(data_g[cap][qm]), np.nanmax(data_g[cap][qm])]\n",
-    "            nbins = int(xrange[1] - xrange[0])\n",
+    "            if len(set(xrange)) == 1:\n",
+    "                xrange = [0, xrange[0]+xrange[0]//2]\n",
+    "                nbins = data_g[cap][qm].shape[0]\n",
+    "            else:\n",
+    "                nbins = int(xrange[1] - xrange[0])\n",
     "\n",
     "            hn, cn = np.histogram(data, bins=nbins, range=xrange)\n",
     "\n",