Can you use a variable to set the scale of a graph

I’m plotting a curve in the graphing calculator that has a wide range depending on a user slider. What I’d like to do is find the peak then round it to a slightly higher number (no problem so far) then use that to set the upper limit of the graph scale. Is there a way to reference a variable in the graph settings?

Here is an example of using bounds: makebounds() to do this. But it requires working inside an activity. I’m not sure if you can do it just in the grapher.