added legend to 3d plots