

The next step is to draw two rectangles in the front of the graph: one gray, and one white. This might be useful, when you don't know the plotting range beforehand, and want to let gnuplot calculate it for you. If you don't want the gradient, you can drop these definitions, and you haven't got to specify the range in the plot either. I should also point out that the first four numbers that are needed for the xrange and yrange, are needed only because we have to "synchronise" the plot with its background. The next three lines are necessary only if you want to draw the background gradient, but if you are happy with a white plot, you can skip this. 'key1' and 'key2' are just two arbitrary strings, holding the text of the key. The next number (lh) gives the hight of one key line, while 'al' will be the length of the line which represents the curve. This is why it is handy to define them at the beginning of the script, so if you are not satisfied with the results, you can easily adjust both the position and the size. We will have to make our own key, and the size of the key will depend on the particular terminal one uses.

The next four numbers specify the position and the size of the key. The first four numbers define the xrange and the yrange. I collected all variables at the beginning of the script, so that it will be easier to adapt it to any situations. Set arrow from graph rx, ry+lh rto al, 0 lt 3 lw 1.5 nohead front Set arrow from graph rx, ry+2*lh rto al, 0 lt 1 lw 1.5 nohead front Set label 2 at graph 1.1*al+rx, ry+lh key2 front Set label 1 at graph 1.1*al+rx, ry+2*lh key1 front Set object 2 rect from graph rx-eps,ry+eps rto kw,kh front fs empty Set object 1 rect from graph rx,ry rto kw,kh fc rgb "#aaaaaa" fs solid 1.0 front lw 0 Ps var pt var lc rgb var lw 5.5 notitle, \įor keyentry w lp ps myPs(c) pt myPt(c) lc rgb m圜olor(c) lw 5.I believe the steps are quite straightforward, so I won't spend too much time on explaining every detail. Script: (tested with gnuplot 5.2.8) # conditional plot

Depending on your version you might need to adapt the order. '' u 1:(isMax(4,2,3)) w lp lw 9.5 pt 8 ps 2.5 lc "green" ti "t3"Īlternative Solution: (with fixed linewidth and variable ps,pt,color)Īttention: there is/was a mix-up of order of variable pointtype and pointsize from gnuplot 5.2 to 5.4 (see ).

The connection lines are plotted first with variable color but constant linewidth (since there is no easy variable linewidth).ĬolMax(col1,col2,col3) = (v1=column(col1), v2=column(col2), v3=column(col3), \
#GNUPLOT SET KEY CODE#
After running this code I have face one problem. "data" using 1:4 title "t3" with linespoint lw 9.5 pt 8 ps 2.5 lt 1 lc rgb "green" "data" using 1:3 title "t2" with linespoint lw 9.5 pt 3 ps 2.5 lt 1 lc rgb "red" ,\ Plot "data" using 1:2 title "t1" with linespoint lw 5.5 pt 6 ps 3.5 lt 1 lc rgb "blue" ,\ Set key width 6.8 height 0.5 box top right Set key noinvert samplen 4 spacing 1.5 width 3 height 1 Set terminal postscript eps enhanced color font 'Helvetica-Bold'
