<Keyword>set</Keyword><Normal Text> </Normal Text><Option>terminal</Option><Normal Text> pdf</Normal Text><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>"data-simple"</String><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>2</Decimal><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>lines</Data Type><Keyword>,</Keyword><Normal Text> </Normal Text><Symbol>\</Symbol><br/>
<Normal Text>     </Normal Text><String>"data-simple"</String><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>3</Decimal><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>linespoints</Data Type><br/>
<Normal Text></Normal Text><br/>
<Comment># simple plotting</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text>                                </Normal Text><Comment># assumes col1=x, col2=y; shows '+' at data points</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>lines</Data Type><Normal Text>                     </Normal Text><Comment># connect points with a line</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># plot a subset of the data</Comment><br/>
<Keyword>plot</Keyword><Data Type>[</Data Type><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>5</Decimal><Data Type>]</Data Type><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>linespoints</Data Type><Normal Text>          </Normal Text><Comment># plot the first 5 elements</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># add a title to your line</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>lines</Data Type><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>'my curve'</String><Normal Text>    </Normal Text><Comment># this is really the line-title in the legend</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># map the columns to the x- and y-axes</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>2</Decimal><Normal Text>                      </Normal Text><Comment># 1=x, 2=y (this is the default)</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.dat'</String><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>2</Decimal><Data Type>:</Data Type><Decimal>1</Decimal><Normal Text>                      </Normal Text><Comment># 2=x, 1=y (reverse the graph)</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># abbreviations</Comment><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'2col.csv'</String><Normal Text> </Normal Text><Option>u</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>2</Decimal><Normal Text> </Normal Text><Option>w</Option><Normal Text> </Normal Text><Data Type>l</Data Type><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>'Squared'</String><Normal Text>      </Normal Text><Comment># 'u' - using, 'w l' - with lines</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>'Hello, world'</String><Normal Text>                       </Normal Text><Comment># plot title</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>xlabel</Option><Normal Text> </Normal Text><String>'Time'</String><Normal Text>                              </Normal Text><Comment># x-axis label</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>ylabel</Option><Normal Text> </Normal Text><String>'Distance'</String><Normal Text>                          </Normal Text><Comment># y-axis label</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># labels</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>label</Option><Normal Text> </Normal Text><String>"boiling point"</String><Normal Text> </Normal Text><Option>at</Option><Normal Text> </Normal Text><Decimal>10</Decimal><Keyword>,</Keyword><Normal Text> </Normal Text><Decimal>212</Decimal><br/>
<Normal Text></Normal Text><br/>
<Comment># key/legend</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> </Normal Text><Data Type>top</Data Type><Normal Text> </Normal Text><Data Type>right</Data Type><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> </Normal Text><Data Type>box</Data Type><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> </Normal Text><Data Type>left</Data Type><Normal Text> </Normal Text><Data Type>bottom</Data Type><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> </Normal Text><Data Type>bmargin</Data Type><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> </Normal Text><Decimal>0.01</Decimal><Keyword>,</Keyword><Decimal>100</Decimal><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>nokey</Option><Normal Text>     </Normal Text><Comment># no key</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment># arrow</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>arrow</Option><Normal Text> </Normal Text><Option>from</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Keyword>,</Keyword><Decimal>1</Decimal><Normal Text> </Normal Text><Option>to</Option><Normal Text> </Normal Text><Decimal>5</Decimal><Keyword>,</Keyword><Decimal>10</Decimal><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>multiplot</Option><Normal Text>                       </Normal Text><Comment># multiplot mode (prompt changes to 'multiplot')</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>size</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Keyword>,</Keyword><Normal Text> </Normal Text><Decimal>0.5</Decimal><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>origin</Option><Normal Text> </Normal Text><Decimal>0.0</Decimal><Keyword>,</Keyword><Decimal>0.5</Decimal><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Function>sin</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Keyword>,</Keyword><Normal Text> </Normal Text><Function>log</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>origin</Option><Normal Text> </Normal Text><Decimal>0.0</Decimal><Keyword>,</Keyword><Decimal>0.0</Decimal><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Function>sin</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Keyword>,</Keyword><Normal Text> </Normal Text><Function>log</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Keyword>,</Keyword><Normal Text> </Normal Text><Function>cos</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>unset</Keyword><Normal Text> </Normal Text><Option>multiplot</Option><Normal Text>                     </Normal Text><Comment># exit multiplot mode (prompt changes back to 'gnuplot')</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Function>sin</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>'Sine Function'</String><Keyword>,</Keyword><Normal Text> </Normal Text><Function>tan</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>'Tangent'</String><br/>
<Normal Text></Normal Text><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Function>sin</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Function>sin</Function><Symbol>(</Symbol><Normal Text>x</Normal Text><Symbol>)</Symbol><Operator>/</Operator><Normal Text>x</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>'bp-hr.dat'</String><Normal Text> </Normal Text><Option>u</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>2</Decimal><Normal Text> </Normal Text><Option>w</Option><Normal Text> </Normal Text><Data Type>lp</Data Type><Normal Text> </Normal Text><Option>t</Option><Normal Text> </Normal Text><String>'systolic'</String><Keyword>,</Keyword><Normal Text> </Normal Text><String>'bp-hr.dat'</String><Normal Text> </Normal Text><Option>u</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>3</Decimal><Normal Text> </Normal Text><Option>w</Option><Normal Text> </Normal Text><Data Type>lp</Data Type><Normal Text> </Normal Text><Option>t</Option><Normal Text> </Normal Text><String>'diastolic'</String><Keyword>,</Keyword><Normal Text> </Normal Text><String>'bp-hr.dat'</String><Normal Text> </Normal Text><Option>u</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>4</Decimal><Normal Text> </Normal Text><Option>w</Option><Normal Text> </Normal Text><Data Type>lp</Data Type><Normal Text> </Normal Text><Option>t</Option><Normal Text> </Normal Text><String>'heartrate'</String><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>terminal</Option><Normal Text> </Normal Text><Data Type>postscript</Data Type><Normal Text> color </Normal Text><Option>noenhanced</Option><Normal Text> </Normal Text><Comment>##setting the term</Comment><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>output</Option><Normal Text> </Normal Text><String>"multiple_files.ps"</String><br/>
<Normal Text></Normal Text><br/>
<Keyword>set</Keyword><Normal Text> </Normal Text><Option>key</Option><Normal Text> center </Normal Text><Comment>##legend placement</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Data Type>[</Data Type><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>5</Decimal><Data Type>][</Data Type><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>120</Decimal><Data Type>]</Data Type><Normal Text> </Normal Text><Symbol>\</Symbol><br/>
<Normal Text>    </Normal Text><Control Flow>for</Control Flow><Normal Text> </Normal Text><Data Type>[</Data Type><Variable Declaration>i</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>3</Decimal><Data Type>]</Data Type><Normal Text> </Normal Text><String>"file_"</String><Operator>.</Operator><Normal Text>i</Normal Text><Operator>.</Operator><String>".dat"</String><Normal Text> </Normal Text><Symbol>\</Symbol><br/>
<Normal Text>    </Normal Text><Option>pointsize</Option><Normal Text> </Normal Text><Decimal>1.3</Decimal><Normal Text> </Normal Text><Option>linecolor</Option><Normal Text> i</Normal Text><Operator>+</Operator><Decimal>4</Decimal><Normal Text> </Normal Text><Symbol>\</Symbol><br/>
<Normal Text>    </Normal Text><Option>title</Option><Normal Text> </Normal Text><String>"file</String><Escaped Char>\_</Escaped Char><String>"</String><Operator>.</Operator><Normal Text>i</Normal Text><Operator>.</Operator><String>".dat"</String><Normal Text> </Normal Text><Symbol>\</Symbol><br/>
<Normal Text>    </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>linespoints</Data Type><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Function Declaration>file_name</Function Declaration><Symbol>(</Symbol><Variable Declaration>n</Variable Declaration><Symbol>)</Symbol><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><Function>sprintf</Function><Symbol>(</Symbol><String>"file_%d.dat"</String><Keyword>,</Keyword><Normal Text> </Normal Text><Variable>n</Variable><Symbol>)</Symbol><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Control Flow>for</Control Flow><Data Type>[</Data Type><Variable Declaration>i</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Variable>N</Variable><Data Type>]</Data Type><Normal Text> </Normal Text><Function>file_name</Function><Symbol>(</Symbol><Normal Text>i</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Option>title</Option><Normal Text> </Normal Text><Function>file_name</Function><Symbol>(</Symbol><Normal Text>i</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment># data blocks</Comment><br/>
<Variable>$Mydata</Variable><Normal Text> </Normal Text><Symbol><<</Symbol><Normal Text> </Normal Text><Heredoc>EOD</Heredoc><br/>
<Decimal>11</Decimal><Normal Text> </Normal Text><Decimal>22</Decimal><Normal Text> </Normal Text><Decimal>33</Decimal><Normal Text> first line of data</Normal Text><br/>
<Decimal>44</Decimal><Normal Text> </Normal Text><Decimal>55</Decimal><Normal Text> </Normal Text><Decimal>66</Decimal><Normal Text> second line of data</Normal Text><br/>
<Comment># comments work just as in a data file</Comment><br/>
<Decimal>77</Decimal><Normal Text> </Normal Text><Decimal>88</Decimal><Normal Text> </Normal Text><Decimal>99</Decimal><br/>
<Heredoc>EOD</Heredoc><br/>
<Keyword>stats</Keyword><Normal Text> </Normal Text><Variable>$Mydata</Variable><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>3</Decimal><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><Variable>$Mydata</Variable><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>3</Decimal><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>points</Data Type><Keyword>,</Keyword><Normal Text> </Normal Text><Variable>$Mydata</Variable><Normal Text> </Normal Text><Option>using</Option><Normal Text> </Normal Text><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>2</Decimal><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Data Type>impulses</Data Type><br/>
<Normal Text></Normal Text><br/>
<Keyword>print</Keyword><Normal Text> </Normal Text><String>'`hostname -s`: '</String><Operator>.</Operator><String>"</String><Backquote>`</Backquote><Command>hostname</Command><Normal Text> </Normal Text><Option>-s</Option><Backquote>`</Backquote><String>"</String><br/>
<Normal Text></Normal Text><br/>
<Variable Declaration>style1</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><String>"lines lt 4 lw 2"</String><br/>
<Variable Declaration>style2</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><String>"points lt 3 pt 5 ps 2"</String><br/>
<Variable Declaration>range1</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><String>"using 1:3"</String><br/>
<Variable Declaration>range2</Variable Declaration><Normal Text> </Normal Text><Operator>=</Operator><Normal Text> </Normal Text><String>"using 1:5"</String><br/>
<Keyword>plot</Keyword><Normal Text> </Normal Text><String>"foo"</String><Normal Text> </Normal Text><Macro>@range1</Macro><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Macro>@style1</Macro><Keyword>,</Keyword><Normal Text> </Normal Text><String>"bar"</String><Normal Text> </Normal Text><Macro>@range2</Macro><Normal Text> </Normal Text><Option>with</Option><Normal Text> </Normal Text><Macro>@style2</Macro><br/>
<Normal Text></Normal Text><br/>
<Variable Declaration>v</Variable Declaration><Operator>=</Operator><Decimal>0</Decimal><br/>
<Control Flow>if</Control Flow><Normal Text> </Normal Text><Symbol>(</Symbol><Variable>v</Variable><Operator>%</Operator><Decimal>2</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"2"</String><br/>
<Symbol>}</Symbol><Normal Text> </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Control Flow>if</Control Flow><Normal Text> </Normal Text><Symbol>(</Symbol><Variable>v</Variable><Operator>%</Operator><Decimal>3</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"3"</String><br/>
<Symbol>}</Symbol><Normal Text> </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"fred"</String><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Variable Declaration>v</Variable Declaration><Operator>=</Operator><Variable>v</Variable><Operator>+</Operator><Decimal>1</Decimal><Symbol>;</Symbol><Normal Text> </Normal Text><Control Flow>if</Control Flow><Normal Text> </Normal Text><Symbol>(</Symbol><Variable>v</Variable><Operator>%</Operator><Decimal>2</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"2"</String><Normal Text> </Normal Text><Symbol>;</Symbol><Normal Text> </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Control Flow>if</Control Flow><Normal Text> </Normal Text><Symbol>(</Symbol><Variable>v</Variable><Operator>%</Operator><Decimal>3</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"3"</String><Symbol>;</Symbol><Normal Text> </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Keyword>print</Keyword><Normal Text> </Normal Text><String>"fred"</String><br/>
<Normal Text></Normal Text><br/>
<Keyword>do</Keyword><Normal Text> </Normal Text><Control Flow>for</Control Flow><Normal Text> </Normal Text><Data Type>[</Data Type><Variable Declaration>N</Variable Declaration><Operator>=</Operator><Decimal>1</Decimal><Data Type>:</Data Type><Decimal>5</Decimal><Data Type>]</Data Type><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>plot</Keyword><Normal Text> </Normal Text><Function>func</Function><Symbol>(</Symbol><Normal Text>N</Normal Text><Keyword>,</Keyword><Normal Text> x</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>pause</Keyword><Normal Text> </Normal Text><Operator>-</Operator><Decimal>1</Decimal><br/>
<Symbol>}</Symbol><br/>
