implement scale bar plugin (fix #291)