centralized legend setup; solved bug with legend and twin axes