update legend and pdf