We have investigated the effect of annealing on the magnetic anisotropy of MBE-grown GaMnAs1−yPy film in which phosphorus content varies from 0% to 24% along the growth direction. Such variation is achieved by growing a series of GaMnAs1−yPy layers in which y is successively increased. Hall effects measurements on an as-grown graded film reveal that the bottom 80% of the film has in-plane easy axes, 10% has both in-plane and perpendicular easy axes, and the remaining 10% has a vertical easy axis. Such gradual change of magnetic anisotropy in the film from in-plane to perpendicular with increasing P concentration is in accordance with the continuous variation of strain from compressive to tensile as the P concentration increases the bottom of the film to tensile toward its tip surface. However, thermal annealing significantly changes the magnetic anisotropy of the graded GaMnAs1−yPy film. In particular, the intermediate region having both in-plane and perpendicular easy axes nearly disappears in the film after annealing, so the film is divided into two types of layers having either only in-plane or only perpendicular anisotropy. These dramatic changes in magnetic anisotropy of the graded GaMnAs1−yPy film introduced by annealing suggest that one can strategically use this process to realize orthogonal magnetic bilayers consisting of in-plane and perpendicular easy axes.