getmax function

getmax can be used to define the upper bound for a plot