Created plot3.R and plot3.png. Had some trouble with R cropping the legend until I figure out that the plot window defines the aspect ratio for the legend.