diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py
index 51b7551c0d2b0bfff1d595dc4184a2c9ce5c8c09..cadc2e50e2cbddc7442537357c798c547dab494f 100644
--- a/flatland/utils/graphics_pil.py
+++ b/flatland/utils/graphics_pil.py
@@ -28,9 +28,9 @@ class PILGL(GraphicsLayer):
             self.screen_height = min(self.screen_height,m.height)
             self.screen_width = min(self.screen_width,m.width)
 
-        self.widthPx = 0.95*self.screen_width/(self.width + 1 + self.linewidth)
-        self.heightPx = 0.95*self.screen_height/(self.height + 1 + self.linewidth)
-        self.nPixCell = int(max(1,np.floor(min(self.widthPx,self.heightPx))))
+        w = 0.95*self.screen_width/(self.width + 1 + self.linewidth)
+        h = 0.95*self.screen_height/(self.height + 1 + self.linewidth)
+        self.nPixCell = int(max(1,np.floor(min(w,h))))
 
 
         # Total grid size at native scale