使用gnuplot的动画:只有一个在动画中绘制的cruve,而2个则预期

发布于 2025-02-02 04:46:48 字数 833 浏览 3 评论 0原文

I have the following script which is expected to produce the animations of 2 curves :

#!/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

Every works fine excepted the fact that only one curve is plotted in animation (CAMB-1.3.5) :

Here is an example of frame :

为什么在生成的图像中未考虑“ REDETOT”命令?

I have the following script which is expected to produce the animations of 2 curves :

#!/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

Every works fine excepted the fact that only one curve is plotted in animation (CAMB-1.3.5) :

Here is an example of frame :

enter image description here

Why the "replot" command is not taken into account in the generated image ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

〗斷ホ乔殘χμё〖 2025-02-09 04:46:48

Just for the sake of the SO-rule "no answer in comments":

Check help plot:

 语法: 

      绘制{&lt; ranges&gt;}&lt; plot-element&gt; {,&lt; plot-element&gt;,&lt; plot-element&gt;}
 
 示例: 

      绘制罪(x)
      绘制罪(x),cos(x)
      图f(x)= sin(x*a),a = .2,f(x),a = .4,f(x)
      绘制“ datafile.1”,带线,“ datafile.2”带上点
      图[t = 1:10] [-pi:pi*2] tan(t),\
           “ data.1”使用(tan($ 2)):($ 3/$ 4)平滑CSPLINES \
                    轴x1y2通知第5行
      datafile中的datafile的绘图
 

Just for the sake of the SO-rule "no answer in comments":

Check 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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文