fix grouping factor to display properly in legend