Warning, /frameworks/syntax-highlighting/autotests/folding/test.gp.fold is written in an unsupported language. File is not indexed.

0001 set terminal pdf
0002 plot "data-simple" using 1:2 with lines, \
0003      "data-simple" using 1:3 with linespoints
0004 
0005 # simple plotting
0006 plot '2col.dat'                                # assumes col1=x, col2=y; shows '+' at data points
0007 plot '2col.dat' with lines                     # connect points with a line
0008 
0009 # plot a subset of the data
0010 plot[1:5] '2col.dat' with linespoints          # plot the first 5 elements
0011 
0012 # add a title to your line
0013 plot '2col.dat' with lines title 'my curve'    # this is really the line-title in the legend
0014 
0015 # map the columns to the x- and y-axes
0016 plot '2col.dat' using 1:2                      # 1=x, 2=y (this is the default)
0017 plot '2col.dat' using 2:1                      # 2=x, 1=y (reverse the graph)
0018 
0019 # abbreviations
0020 plot '2col.csv' u 1:2 w l title 'Squared'      # 'u' - using, 'w l' - with lines
0021 
0022 set title 'Hello, world'                       # plot title
0023 set xlabel 'Time'                              # x-axis label
0024 set ylabel 'Distance'                          # y-axis label
0025 
0026 # labels
0027 set label "boiling point" at 10, 212
0028 
0029 # key/legend
0030 set key top right
0031 set key box
0032 set key left bottom
0033 set key bmargin
0034 set key 0.01,100
0035 
0036 set nokey     # no key
0037 
0038 # arrow
0039 set arrow from 1,1 to 5,10
0040 
0041 set multiplot                       # multiplot mode (prompt changes to 'multiplot')
0042 set size 1, 0.5
0043 
0044 set origin 0.0,0.5
0045 plot sin(x), log(x)
0046 
0047 set origin 0.0,0.0
0048 plot sin(x), log(x), cos(x)
0049 
0050 unset multiplot                     # exit multiplot mode (prompt changes back to 'gnuplot')
0051 
0052 plot sin(x) title 'Sine Function', tan(x) title 'Tangent'
0053 
0054 plot sin(x)
0055 plot sin(x)/x
0056 
0057 plot 'bp-hr.dat' u 1:2 w lp t 'systolic', 'bp-hr.dat' u 1:3 w lp t 'diastolic', 'bp-hr.dat' u 1:4 w lp t 'heartrate'
0058 
0059 set terminal postscript color noenhanced ##setting the term
0060 set output "multiple_files.ps"
0061 
0062 set key center ##legend placement
0063 
0064 plot [1:5][1:120] \
0065     for [i = 1:3] "file_".i.".dat" \
0066     pointsize 1.3 linecolor i+4 \
0067     title "file\_".i.".dat" \
0068     with linespoints
0069 
0070 
0071 file_name(n) = sprintf("file_%d.dat", n)
0072 plot for[i = 1:N] file_name(i) title file_name(i)
0073 
0074 
0075 # data blocks
0076 $Mydata << EOD
0077 11 22 33 first line of data
0078 44 55 66 second line of data
0079 # comments work just as in a data file
0080 77 88 99
0081 EOD
0082 stats $Mydata using 1:3
0083 plot $Mydata using 1:3 with points, $Mydata using 1:2 with impulses
0084 
0085 print '`hostname -s`: '."`hostname -s`"
0086 
0087 style1 = "lines lt 4 lw 2"
0088 style2 = "points lt 3 pt 5 ps 2"
0089 range1 = "using 1:3"
0090 range2 = "using 1:5"
0091 plot "foo" @range1 with @style1, "bar" @range2 with @style2
0092 
0093 v=0
0094 if (v%2) <beginfold id='1'>{</beginfold id='1'>
0095     print "2"
0096 <endfold id='1'>}</endfold id='1'> else if (v%3) <beginfold id='1'>{</beginfold id='1'>
0097     print "3"
0098 <endfold id='1'>}</endfold id='1'> else <beginfold id='1'>{</beginfold id='1'>
0099     print "fred"
0100 <endfold id='1'>}</endfold id='1'>
0101 
0102 v=v+1; if (v%2) print "2" ; else if (v%3) print "3"; else print "fred"
0103 
0104 do for [N=1:5] <beginfold id='1'>{</beginfold id='1'>
0105     plot func(N, x)
0106     pause -1
0107 <endfold id='1'>}</endfold id='1'>