fix legend ordering