Fix to problem where invisible traces appear on legend.