fixed legend plotting