我正在使用双循环绘制 pdf,如下所示:
set terminal pdf
set output "fichier.pdf"
set datafile separator ","
set title "test"
set grid
set ylabel "y"
set xlabel "x"
set autoscale
set key on inside left top
do for [t1=0:1]{
do for [t2=0:1]{
plot 'AirEauG10VEtHDebit1mLMinute.dat' using ($1):($2/(80.4/($2+t1)**2)) title 'e='.t1
replot 'a.dat' using ($1):($2/(80.4/($2+t2)**2)) title 'e='.t2
}
}
unset output
现在,我已经掌握了所有的情节。哪些是所有图表,一张只有一张图,一张有两张图,一张只有一张图等等。但我只想在 pdf 中包含带有两张图的图表。我怎样才能对 gnuplot 说只保存带有两个图的图形?
所以,我不想有 4 页(2 页有一个图,2 页有两个图),我只想只有 2 页(上面有两个图)。
如果我还不够清楚,请告诉我:D
最佳答案
不要使用replot
输出到文件!这仅对交互式绘图终端有意义。
plot
命令可以有许多图,用逗号分隔:
set terminal pdf
set output "fichier.pdf"
set datafile separator ","
f(x, t) = x/(80.4/(x + t)**2)
do for [t1=0:1] {
do for [t2=0:1] {
plot 'AirEauG10VEtHDebit1mLMinute.dat' u 1:(f($2, t1)) title 'e='.t1,\
'a.dat' u 1:(f($2, t2)) title 'e='.t2
}
}
关于loops - 如何在 gnuplot 中仅选择少数图输出为 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37618062/