save plot to png and make legends