title: How can I create a legend without a plot in R?
body: <p>This is for an art project. I've created a scatterplot with many dots of 5 different colours. I want to create a legend that is completely separate from the plot, as in it is not on the plot, nor beside the plot, but is in it's own window so I can save the legend as it's own .pdf file. This is so I can have my plot and legend printed separately as they well be hung in a gallery as separate pieces.</p>
  
  <p>All I want is to recreate this image using R:</p>
  
  <p><a href="https://i.stack.imgur.com/VAWRl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VAWRl.png" alt="enter image description here"></a></p>
  
  <p>Is this even possible?</p>
  
  <p>Thanks,</p>
  
  <p>Jay</p>