title: Gnuplot: using custom point shapes, with legend entry
body: <p>Gnuplot provides a number of point styles to use in scatter plots, such as a cross, a star, a square, a circle etc. The available point types can be <a href="http://i.stack.imgur.com/zojYF.png">demonstrated</a> by using the <code>test</code> command.</p>
  
  <p>However, for a specific application, I need different symbols, and I need legend entries that show these symbols.</p>
  
  <p>In particular, I need more than four symbols that can be plotted both in outlined and in filled state (e. g. triangles pointing left or right, parallelograms or non-square rectangles).</p>
  
  <p>There are a number of approaches to use other shapes (each with some requirements towards the terminal, e. g. unicode support):</p>
  
  <ul>
  <li><a href="http://fityk-tutorials.blogspot.de/2010/11/gnuplot-cygwin-and-gnuplot-custom.html">using PNG images</a></li>
  <li>using <code>set label '□' at 3,4</code> for each point, where □ can be replaced by any unicode character, such as ◁, ▶, ▭, ▮, etc.)</li>
  <li>using <code>plot ... with labels</code> and providing a unicode character as a label</li>
  </ul>
  
  <p>The problem with all of these approaches is that I can't get a proper legend (key) entry including the symbol.</p>
  
  <p>I considered plotting the legend myself, but there are two reasons why I don't think that this is feasible:</p>
  
  <ul>
  <li>For plotting the legend to the right of the chart (or at the lower right inside the chart), I would need to calculate the width of the legend, which depends on the font.</li>
  <li>Some of the plots may include both a line and a points (like <code>using linespoints</code> for regular Gnuplot point types), which both have to be shown in the legend.</li>
  </ul>
  
  <p>I am generating the Gnuplot input files programmatically, so an approach that explicitly lists all points (like the <code>set label</code> approach mentioned above), or that requires some calcuations, is OK.</p>