refactor autoplot code and fix bug (parameters now do not need to be named x1 and x2 for plotting)