sort conditions in plot and tabulate