legend and layout