How to set axis range in my code?

See also this HowTo: How to set ranges on axis?