scalar replacement & legend in plots