move polypath creation before legend and select colors in path creation