title: Four variable Scatter plot with colour legend in r
body: <p>I want to plot a scatter plot with four variables with one variable as a factor. This is the expected plot below</p>
  <p><a href="https://i.stack.imgur.com/uZkcE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uZkcE.png" alt="enter image description here" /></a></p>
  <p>I'm not able to plot with this code</p>
  <pre><code>omgp &lt;- ggplot(Q, aes(x = Sal, y = Tmp, colour = as.factor(Station), )) + 
    geom_point(size = 3 ) + 
    scale_color_gradient(low = &quot;#AF7AC5&quot;, high = &quot;#E74C3C&quot;) + 
    scale_x_continuous(name = 'Salinity') + 
    scale_y_continuous(name =  Temperature °C') +
    theme_bw() + 
    ggtitle('Scatter plot Calcite Saturation State and 
    Temperature')
  </code></pre>
  <p>Here is the error message I'm getting
  Can anyone help me with code to reproduce this scatter plot?</p>