Less fragile bplotdevice script