format legends