Made into a function callable from the shell.  Renamed.  Fixed re-centering issue.  Added auto-calculating scalebar.