title: ggplot: scale_color_steps()-like color scale for ordered factors
body: <p>With <code>scale_color_steps()</code> we can set from what to what color we want the scale to evolve by setting the <code>low</code> and the <code>high</code> argument. An example:</p>
  <pre><code>df &lt;- data.frame(x= rnorm(99), y= rnorm(99), col= rnorm(99))
  ggplot(df, aes(x, y, col= col)) +
    geom_point() +
    scale_color_steps(low= &quot;blue&quot;, high= &quot;red&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/caw9Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/caw9Q.png" alt="cont" /></a></p>
  <p>This works for continuous <code>col</code> variables but I want to achieve the same for ordered factors, i.e. <strong>I want to set that the lowest color of my lowest factor level is <code>col1</code> (for example blue) and the highest <code>col2</code> (for example red). Is this possible?</strong></p>
  <p><strong>What I've tried</strong>: I recently asked a question about color scales and got an <a href="https://stackoverflow.com/questions/70942728/understanding-color-scales-in-ggplot2">incredible answer</a>. Unfortunately, what I want to do seems to be not part of the 2*22 ggplot2 color scaling functions. So I guess I need some hacky solution? So far I simply use <code>as.numeric</code> for the ordered factor...</p>
  <pre><code>df &lt;- data.frame(x= rnorm(99), y= rnorm(99), col= ordered(factor(rep(c(&quot;small&quot;, &quot;middle&quot;, &quot;high&quot;), 3))))
  ggplot(df, aes(x, y, col= as.numeric(col))) +
    geom_point() +
    scale_color_steps(low= &quot;blue&quot;, high= &quot;red&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/34bqD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/34bqD.png" alt="discr" /></a></p>
  <p>... but the problem is that (i) the factor levels are missing in the legend (obviously) and (ii) there are more color steps in the legend then factor levels but I want them to be the same. Can we fix both with the approach above or is there another way to do it?</p>