我有以下腳本,預計會產生 2 條曲線的影片:
#!/bin/bash
for i in {1..397}; do
gnuplot -p <<-EOFMarker
set terminal png;
set output "pic$i.png";
set title "power spectrum";
set xlabel "scale (k)";
set ylabel "P(k)";
set key top left;
set grid;
set ytics out nomirror;
set xtics out nomirror;
set logscale x;
set logscale y;
set format x "10^{%L}";
set yrange [0:30000];
plot "CAMB-1.3.5/matter_camb$i" u 1:2 w l;
replot "EFTCAMB_v3_beta/matter_eftcamb$i" u 1:2 w l;
EOFMarker
done
# Build movie with ffmpeg
ffmpeg -start_number 1 -i pic%d.png movie.mpeg
除了在影片中僅繪制一條曲線(CAMB-1.3.5)之外,每項作業都很好:
這是一個框架示例:

為什么replot生成的影像中沒有考慮“”命令?
uj5u.com熱心網友回復:
只是為了 SO 規則“評論中沒有答案”:
檢查help plot:
Syntax: plot {<ranges>} <plot-element> {, <plot-element>, <plot-element>}
Examples: plot sin(x) plot sin(x), cos(x) plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x) plot "datafile.1" with lines, "datafile.2" with points plot [t=1:10] [-pi:pi*2] tan(t), \ "data.1" using (tan($2)):($3/$4) smooth csplines \ axes x1y2 notitle with lines 5 plot for [datafile in "spinach.dat broccoli.dat"] datafile
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/481863.html
