Credits Overview Plotting Styles Commands Terminals

if

Syntax:

      if (<condition>) { <commands>;
             <commands>
             <commands>
      } else if (<condition>) {
             <commands>
      } else {
             <commands>
      }

This version of gnuplot supports block-structured if/else statements. If the keyword if or else is immediately followed by an opening "{", then conditional execution applies to all statements, possibly on multiple input lines, until a matching "}" terminates the block. If commands may be nested.

The old single-line if/else syntax fromm gnuplot version 4 is still supported, but cannot be mixed with the new block-structured syntax. See if-old.

Subtopics