Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not possible to use a regexp for <code>set datafile missing</code>, but you can use any program to filter you data before plotting, and replacing a regexp with one character, e.g. <code>?</code> which you set to mark a missing data point.</p> <p>Here is an example which accomplishes, what you originally requested: filtering <code>-nan</code>, <code>inf</code> etc. For testing, I used the following data file:</p> <pre><code>1 0 2 nan 3 -inf 4 2 5 -NaN 6 1 </code></pre> <p>And the plotting script may look like the following:</p> <pre><code>filter = 'sed -e "s/-\?\(nan\|inf\)/?/ig"' set datafile missing "?" set offset 0.5,0.5,0.5,0.5 plot '&lt; '.filter.' data.txt' with linespoints ps 2 notitle </code></pre> <p>This gives the following output:</p> <p><img src="https://i.stack.imgur.com/PiPpO.png" alt="enter image description here"></p> <p>So the plot command skips all missing data points. You can refine the <code>sed</code> filter to replace any non-numerical values with <code>?</code>, if this variant is not enough.</p> <p>This works fine, but allows only to select columns e.g. with <code>using 1:2</code>, but not doing computations on the columns, like e.g. <code>using ($1*0.1):2</code>. To allow this, you can filter out any row, which contains <code>nan</code>, <code>-inf</code> etc with <code>grep</code>, like its done in <a href="https://stackoverflow.com/a/7607368/2604213">gnuplot missing data with expression evaluation</a> (thanks @Thiru for the link):</p> <pre><code>filter = 'grep -vi -- "-\?\(nan\|inf\)"' set offset 0.5,0.5,0.5,0.5 plot '&lt; '.filter.' data.txt' with linespoints ps 2 notitle </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload