made plot ranges more robust