parameterize the render plot function