title: Scatter plot in racket with individual colors
body: <p>I am exploring the plotting utilities in <code>racket</code>, and I have to say, so far I am incredibly impressed. However, I ran into a small difficulty.</p>
  
  <p>I was trying to make a scatter plot, where each point has its own color (for visualizing classification algorithms). However, I am not sure how to make each point have its own color. Is it possible?</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>(define (random-choice l)
    (list-ref l (random (length l))))
  
  (define (scatter data)
    (let ([x-max (apply max (map first data))]
          [x-min (apply min (map first data))]
          [y-max (apply max (map second data))]
          [y-min (apply min (map second data))]
          [colors (build-list 20 
              ; here I am trying to create a list of desired colors
              ; ,but an error tells me that only single elements are accepted
              (λ _ (random-choice (list "red" "blue")))])
      (parameterize ([plot-new-window? #t]
                     [point-sym 'dot]
                     [point-size 20])
        (plot (points data
              #:color colors)
              #:x-max x-max
              #:x-min x-min
              #:y-max y-max
              #:y-min y-min))))
  </code></pre>
  
  <p>A rough equivalent in <code>R</code> would be:</p>
  
  <pre><code>c &lt;- data.frame(x=rnorm(10),y=rnorm(10))
  colors &lt;- sample(c("red","blue"),10,replace=TRUE)
  plot(c$y,c$x,col=colors)
  </code></pre>
  
  <p>By the way, I would welcome any (and all) comments on my <code>racket</code> code, such as simplifying the boundary specification for the plot.</p>