I am trying to plot scatter plot and color specific dots.
The problem is that the colored dots appear in the lower layer instead of the upper.
how can I change the layers order?
Points in the geom_point() function are plotted in order they appear in the dataset. To ensure that your blue-colored points appear on top, you can simply sort the dataset so that the points with the blue label at all in the end. Here is an example:
Alternatively, you could make the plot a bit come complex by separating the blue points to a different layer and plotting them after the azure points, as ggplot evaluated the layers in order they are put in the code: