I want to plot a scatter plot with four variables with one variable as a factor. This is the expected plot below
I'm not able to plot with this code
omgp <- ggplot(Q, aes(x = Sal, y = Tmp, colour = as.factor(Station), )) +
geom_point(size = 3 ) +
scale_color_gradient(low = "#AF7AC5", high = "#E74C3C") +
scale_x_continuous(name = 'Salinity') +
scale_y_continuous(name = Temperature °C') +
theme_bw() +
ggtitle('Scatter plot Calcite Saturation State and
Temperature')
Here is the error message I'm getting Can anyone help me with code to reproduce this scatter plot?