using R for build-in plotting