Code for the R package magicaxis