close plots, create directory