Use proper style in if statement

Also remove unused 'title' keyword in plot_samples().
Don't use package names as variable names

Bad style. 'file' and 'dir' were the offenders.