title: TikZ: plotting data file with missing values
body: <p>I have this data:</p>
  
  <p><a href="https://i.stack.imgur.com/oXTXm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oXTXm.png" alt="values"></a></p>
  
  <p>data2 is missing the third point. So I thought, I'd define two different x columns and assign data2 to x2. </p>
  
  <p>Problem: the third point of data1 goes up to 3 in the compiled graphic. If I have different and more values, points start to go anywhere, but not where they belong.</p>
  
  <p>That is the code I've used:</p>
  
  <pre><code>\addplot[only marks, mark = diamond, color = orange, mark size = 3pt]
   table[x=x1, y=data1]{example.dat};
  \addlegendentry{data1};
  
  \addplot[only marks, mark = square, color = gray, mark size = 3pt]
   table[x=x2, y=data2]{example.dat};
  \addlegendentry{data2};
  
  \addplot[only marks, mark = o, color = blue, mark size = 3pt]
   table[x=x1, y=data3]{example.dat};
  \addlegendentry{data3};
  </code></pre>
  
  <p>And this is the graph I get:</p>
  
  <p><a href="https://i.stack.imgur.com/OKZxF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OKZxF.png" alt="graph"></a></p>
  
  <p>Thanks a lot!</p>
  
  <p>Btw. in the real data one data set is missing a x/y value in the middle of the data. I hope that doesn't matter compared to my example.</p>