reduces legend to just the entries that are plotted.