title: R ggplot2: legend should be discrete and not continuous
body: <p>I have the following data:</p>
  
  <pre><code>benchmark   mispredpenal    IPC     pred
  ammp        1               1.0589  2lev
  ammp        5               1.0450  2lev
  ...
  </code></pre>
  
  <p>and use the following command:</p>
  
  <pre><code>ggplot(IPC, aes(x = benchmark, y = IPC, group=mispredpenal, colour=mispredpenal)) + 
    geom_point() + geom_line()
  </code></pre>
  
  <p>Everything looks like it should, but I would like the legend to be discrete, and not the continuous (gradient). How should I do this?</p>
  
  <p><strong>Edit:</strong>
  Misprediction is either 1, 5, 9, 13 or 17.</p>
  
  <p><img src="https://i.stack.imgur.com/ZnFKB.png" alt=""></p>