Please see this recent discussion, which more or less also applies as-is to legend_group.
legend_group