R functions for polar plotting