74namespace gnuplot_gen {
80#---common-styles-for-plots-from-Lumiera---------
81set style line 1 linetype 1 linewidth 2 linecolor rgb '#240CC3'
82set style line 2 linetype 3 linewidth 2 linecolor rgb '#1149D6'
83set style line 3 linetype 2 linewidth 2 linecolor rgb '#0B7FCC'
84set style line 4 linetype 6 linewidth 2 linecolor rgb '#37999D'
85set style line 5 linetype 7 linewidth 2 linecolor rgb '#248269'
86set style line 6 linetype 13 linewidth 2 linecolor rgb '#00C443'
87set style line 7 linetype 12 linewidth 2 linecolor rgb '#EBE83E'
88set style line 8 linetype 5 linewidth 2 linecolor rgb '#762C14'
89set style line 9 linetype 4 linewidth 2 linecolor rgb '#AA0519'
91set style line 10 linetype 1 linewidth 1 linecolor rgb '#303030'
92set style line 11 linetype 0 linewidth 1 linecolor rgb '#A0A0A0' dashtype 3
93#---(End)styles----------------------------------
97#---axis-and-grid-setup--------------------------
100set grid back linestyle 11
102set arrow 10 from graph 0,0 to graph 1.04,0 size screen 0.025,15,60 filled ls 10
103set arrow 11 from graph 0,0 to graph 0,1.08 size screen 0.025,15,60 filled ls 10
109# GNUPLOT - data plot from Lumiera
114if TermSize}size ${TermSize}${endif}
116}set term wxt size ${TermSize}
119set datafile separator ",;"
121####---------Data--------------------------------
122$RunData << _End_of_Data_
131}set xlabel '${Xlabel}'
133}stats $RunData using (abscissaName=strcol(1)) every ::0::0 nooutput
135set xlabel abscissaName
138}set ylabel '${Ylabel}' ${end if Ylabel
141set xrange [${Xrange}] ${endif
143set yrange [${Yrange}] ${endif
144}set key autotitle columnheader tmargin
149####---------------------------------------------
150plot for [i=2:*] $RunData using 1:i with ${DiagramKind} linestyle i-1
156stats $RunData using 1:2 nooutput
159}# regression line function (given as parameter)
160regLine(x) = ${RegrSlope} * x + ${RegrSocket}
162}# regression line function derived from data
163regLine(x) = STATS_slope * x + STATS_intercept
166regLabel = sprintf("Model: %3.2f·p + %3.2f", STATS_slope, STATS_intercept)
168set key horizontal width -4
171${else}${if Xrange}${else
174${end if}${end if Xtics
176plots = STATS_columns - 1
177# Adjust layout based on number of data sequences;
178# additional sequences placed into secondary diagram
181 set multiplot layout 2,1 # 2 rows 1 column
182 set lmargin at screen 0.12 # fixed margins to align diagrams
183 set rmargin at screen 0.88
187####---------Scatter-Regression-Plot-------------
188plot $RunData using 1:2 with points linestyle 1, \
189 regLine(x) with line linestyle 9 title regLabel
192 # switch off decorations for secondary diagram
196 set key bmargin vertical
198 set yrange [${Y2range}]
203} set ylabel '${Y2label}' ${endif
206 ####---------------------------------
207 plot $RunData using 1:3 with impulses linestyle 3
210 # more than one additional data sequence
213} set y2range [${Y3range}]
218} set y2label '${Y3label}' offset -1.5
220 ####---------------------------------------------
221 plot $RunData using 1:3 with impulses linestyle 3, \
222 for [i=4:*] $RunData using 1:i with points linestyle 5+(i-4) axes x1y2
243 TextTemplate plot{GNUPLOT_BASIC_PLOT_DEF
244 +GNUPLOT_SIMPLE_DATA_PLOT};
246 params.
set (
"CommonStyleDef", GNUPLOT_CommonStyleDef)
247 .
set (
"AxisGridSetup", GNUPLOT_AxisGridSetup)
250 return plot.render (params.
genNode());
267 TextTemplate plot{GNUPLOT_BASIC_PLOT_DEF
268 +GNUPLOT_SCATTER_REGRESSION};
270 params.set (
"CommonStyleDef", GNUPLOT_CommonStyleDef)
271 .set (
"AxisGridSetup", GNUPLOT_AxisGridSetup)
A complement to allow instantiation of a TextTemplate with ETD data.
A minimalistic text templating engine with flexible data binding.