added an option to define legendnames in plot files