create plot macro