made graph automatically rescale