#!/usr/local/bin/gnuplot -persist # set terminal svg size 600,400 dynamic enhanced font 'arial,10' mousing name "stringvar_2" butt dashlength 1.0 # set output 'stringvar.2.svg' unset border set label 1 "Exercise string handling functions" at graph 0.1, 0.95, 0 left norotate back nopoint set label 2 "" at graph 0.1, 0.9, 0 left norotate back nopoint set label 3 "foo = ABCDEF" at graph 0.1, 0.85, 0 left norotate back nopoint set label 4 "strlen(foo) = 6" at graph 0.1, 0.8, 0 left norotate back nopoint set label 5 "substr(foo,3,4) = CD" at graph 0.1, 0.75, 0 left norotate back nopoint set label 6 "" at graph 0.1, 0.7, 0 left norotate back nopoint set label 7 "haystack = `date`" at graph 0.1, 0.65, 0 left norotate back nopoint set label 8 "haystack = Sat 1 Oct 21:59:44 PDT 2022" at graph 0.1, 0.6, 0 left norotate back nopoint set label 9 "needle = :" at graph 0.1, 0.55, 0 left norotate back nopoint set label 10 "S = strstrt(haystack,needle) = 14" at graph 0.1, 0.5, 0 left norotate back nopoint set label 11 "haystack[S-2:S+2] = 21:59" at graph 0.1, 0.45, 0 left norotate back nopoint set label 12 "It is now 21:59" at graph 0.1, 0.4, 0 left norotate back nopoint set label 13 "" at graph 0.1, 0.35, 0 left norotate back nopoint set label 14 "words(haystack) = 6" at graph 0.1, 0.3, 0 left norotate back nopoint set label 15 "word(haystack,5) = PDT" at graph 0.1, 0.25, 0 left norotate back nopoint set label 16 "" at graph 0.1, 0.2, 0 left norotate back nopoint set label 17 "sprintf output of long strings works OK" at graph 0.1, 0.15, 0 left norotate back nopoint set label 18 "" at graph 0.1, 0.1, 0 left norotate back nopoint set style data lines unset xtics unset ytics set xrange [ * : * ] noreverse writeback set x2range [ * : * ] noreverse writeback set yrange [ 0.00000 : 1.00000 ] noreverse nowriteback set y2range [ * : * ] noreverse writeback set zrange [ * : * ] noreverse writeback set cbrange [ * : * ] noreverse writeback set rrange [ * : * ] noreverse writeback set colorbox vertical origin screen 0.9, 0.2 size screen 0.05, 0.6 front noinvert bdefault NO_ANIMATION = 1 iswindows = 0 isos2 = 0 beg = 2 end = 4 foo = " 1 2 3 4 5 6" haystack = "Sat 1 Oct 21:59:44 PDT 2022" needle = ":" S = 14 plot 0 lc bgnd notitle