externalize legend