# based on code of [[User:Gorgo]]/[[:c:File:Euro exchange rate to TRY.svg]] # gnuplot script for plotting eurofxref-hist.csv as obtained from # http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html infile=system("echo $INFILE") outfile=system("echo $OUTFILE") # Start und Ende ermitteln (z.Zt. nur für Consolenausagabe) stats infile every ::1 u (strptime("%Y-%m-%d",strcol(1))) nooutput print ' -----Stats-(Timestamp)----' print ' Start: ', strftime("%d. %B %Y",STATS_min) print ' Ende: ', strftime("%d. %B %Y",STATS_max) print ' --------------------------' set label 'last update: ' . strftime("%Y-%m-%d",STATS_max) at graph 0.05, graph 0.9 #input set timefmt "%Y-%m-%d" set datafile missing 'N/A' set datafile separator ',' #output set key bottom right set style data lines set border 3 # Rahmen unten (Bit 1) und links (+ Bit 2) unset grid # Gitterlinien verwenden # Gitterlinienen per Hand setzen falls gewünscht set style line 1 linetype rgb '#696969' linewidth 0.25 # Def. Major-grid set style line 2 linetype rgb '#C9C9C9' linewidth 0.15 # def. Minor-grid #set grid xtics mxtics # eventuell noxtics und nomxtics set grid x2tics set grid ytics mytics # eventuell noytics und nomytics set grid back # Gitter im Hintergrund set grid linestyle 1, linestyle 2 # Setzen des linestyle für Major u. Minor # die Kalenderwochen-Markierung machen wir über x2 !!! set xdata time set x2data time set format x '1. %b' if (GPVAL_VERSION >= 5.0) { set xtics rotate by +15 center offset 0,-0.5 } else { set xtics rotate by +15 center offset 0,-0.75 } set format x2 '' set xrange ['2018-01-01':'2019-01-01'] set x2range ['2018-01-01':'2019-01-01'] set x2tics '2018-01-01', 60 * 60 * 24 * 7 set x2tic scale 0 set xtics nomirror unset mxtics set xlabel '2018' set ylabel 'TRY' # set y2label 'TRY' set format y '%.0f' # set format y2 '%.0f' set ytics 1 set mytics 5 set ytics nomirror # Zebramuster set style rect fillcolor lt -1 fillstyle solid 0.06 noborder do for [i=1:12:2] { marker_start=sprintf("2018-%1.2d-01",i) marker_stop =sprintf("2018-%1.2d-01",i+1) print 'setze grauen Marker: ' . marker_start . "-" . marker_stop set object rectangle from marker_start,graph 0 to marker_stop, graph 1 } ## gnuplot for SVG - gnuplot 4.2 / Ubuntu 8.10 if (GPVAL_VERSION >= 5.0) { set term svg size 800,400 font "Arial,16" } else { set term svg size 800,400 font "Arial,12" } set outp outfile set style line 1 lt rgb 'blue' lw 1 #available currencies: #first one is $2, second $3 and so on #USD,JPY,BGN,CYP,CZK,DKK,EEK,GBP,HUF,LTL,LVL,MTL,PLN,ROL,RON,SEK,SIT,SKK,CHF,ISK,NOK,HRK,RUB,TRL,TRY,AUD,BRL,CAD,CNY,HKD,IDR,ILS,INR,KRW,MXN,MYR,NZD,PHP,SGD,THB,ZAR plot \ infile \ usi 1:($26) axis x1y1 tit '1 EUR in TRY' lt rgb 'blue' lw 1,\ infile \ usi 1:($26) axis x1y1 notit w p lc rgb 'black' lt 1 lw 1.5 pt 7 ps 0.1 \