# set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 600, 400 # set output 'stringvar.2.png' set bar 1.000000 front set style circle radius graph 0.02, first 0.00000, 0.00000 set style ellipse size graph 0.05, 0.03, first 0.00000 angle 0 units xy set label 1 "Exercise string handling functions\n\nfoo = ABCDEF\nstrlen(foo) = 6\nsubstr(foo,3,4) = CD\n\nhaystack = `date`\nhaystack = Fri Oct 28 21:05:38 PDT 2016\nneedle = :\nS = strstrt(haystack,needle) = 14\nhaystack[S-2:S+2] = 21:05\nIt is now 21:05\n\nwords(haystack) = 6\nword(haystack,5) = PDT\n\nsprintf output of long strings works OK\n" at graph 0.1, 0.9, 0 left norotate back nopoint set style textbox transparent margins 1.0, 1.0 border unset logscale set style data lines unset xtics unset ytics unset paxis 1 tics unset paxis 2 tics unset paxis 3 tics unset paxis 4 tics unset paxis 5 tics unset paxis 6 tics unset paxis 7 tics set yrange [ 0.00000 : 1.00000 ] noreverse nowriteback set paxis 1 range [ * : * ] noreverse nowriteback set paxis 2 range [ * : * ] noreverse nowriteback set paxis 3 range [ * : * ] noreverse nowriteback set paxis 4 range [ * : * ] noreverse nowriteback set paxis 5 range [ * : * ] noreverse nowriteback set paxis 6 range [ * : * ] noreverse nowriteback set paxis 7 range [ * : * ] noreverse nowriteback set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front noinvert bdefault beg = 2 end = 4 foo = " 1 2 3 4 5 6" haystack = "Fri Oct 28 21:05:38 PDT 2016" needle = ":" S = 14 plot 0