使用以下gnuplot脚本 set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'solving for p' | cut -d ' ' -f9 | tr -d ','" title 'p' with lines,\
pause 1 和这个版本 $ gnuplot --version
gnuplot 4.
我正试图将bash脚本与gnuplot结合起来。我使用的是一个输入文件'input.list‘,其中包含要用gnuplot分析的文件的单列列表。我使用以下bash脚本:
#!/bin/bash
while read -r line
do
...
#Other operations on files
...
gnupinp=$line
gnuplot -e "input='${gnupinp}'; plot input u 1:2; pause -1"
done &
在我的OS系统上,我使用默认的'qt‘终端开发了一系列gnuplot脚本。这样可以方便地在脚本完成时关闭qt窗口,因此我添加了以下内容:
pause mouse "mouse button 2 or 3 to close\n";
在稍后的开发中,我希望输出到pdf,但现在暂停挂起我的命令行终端,直到我点击返回。我想做:
set terminal pdf
...
if (terminal eq qt) pause mouse "mouse button 2 or 3 to close\n";
但这给了我:
第45行:未定义变量:终端
现在,我有了一个解决办
我想使用Fortran将GNUPLOT命令写到txt文件中,我可以对大多数简单的命令这样做,但是编写包含特殊字符或AWK命令的命令有问题。
假设我有一个三列输入文件。第一列用于设置其坐标存储在列2和3中的点的颜色。
例如,我的输入文件"Input.dat“如下所示:
blue 1 1
red 2 1
red 3 0
blue 4 1
red 5 1
blue 6 1
我使用以下txt文件,其中包含GNUPLOT命令,并用于绘制输入文件。
GNUPLOT.txt:
plot "< awk '{if($1 == \"blue\") print}&
我从脚本stuff.pl中获取数据,并希望动态地绘制成一个图。因此,我将在Gnuplot (v4.6 patchlevel 3)中使用一个循环,这将导致以下问题:
使用文件TEST.gp
xCol=2; yCol=3
set term x11 1
plot '< stuff.pl' u xCol:yCol
xCol=4; yCol=5
set term x11 1
set autoscale y
replot '< stuff.pl' u xCol:yCol
pause 1
并通过gnuplot TEST.gp运行它,我的图没有适当的缩放。这幅图
我想要创建一个Perl (或Bash)脚本来动态创建和绘制数据。这意味着我希望从日志文件file.log中提取数据,理想情况下不要编写tmp-文件(如果只有tmp-文件才有可能,这也可以)和用Gnuplot绘图。随着日志文件的不断增长,我希望看到图中的其他信息。
类似的主题请参见。
对于Perl,到目前为止,我拥有的是以下脚本:
#!/usr/bin/perl
use strict;
use warnings;
my $path = "file.log";
my @grepped;
my $switch = "off";
open(INFILE,
我希望能够使用gnuplot来绘制数据‘实时’,例如,我有一个文件"foo.st“,它是一个数据文件,由列分隔。"foo.st“中的数据是从实时变量中实时收集的,我想让gnuplot打开并绘制来自"foo.st”的数据作为其连续记录的数据。理想情况下,我希望图显示一个“1秒”图,然后刷新显示下一个“1秒”的数据,然后再刷新显示下一个“1秒”的数据.现在,我有一个gnuplot脚本"foo.p“,内容如下:
set autoscale
set xtic auto
set ytic auto
set title "Leg Position"
set
我正在使用以下命令在gnuplot上绘制一个简单的sin(x)图,其中包含来自VS2010 C++的管道
set terminal windows
set title 'Graph of velocity versus time'
set xrange[0:10]
plot sin (x)
问题是窗口关闭得太快了。我不想使用'pause‘命令,因为它会停止整个代码。
有没有其他方法可以在不使用pause命令的情况下保持此窗口打开?
干杯
这是我的剧本
set title "Frequency graph"
set xlabel "Words"
set ylabel "Frequency"
set boxwidth 0.5
set style fill solid
plot "gnuplot.data" using 1:3:xtic(2) with boxes
pause -1 "Hit any key to continue"
基于的答案。
其结果是:
您看,我希望使用1:3:xtic(2)的"gnuplot.data“和红色的水平
我想知道如何保存动画或在Gnuplot上的每一个情节。例如,在这个数据文件:中,当我绘制Fromm方案"gnuplot plot_fromm.gnu“的结果时,我可以按enter键看到动画,但是我希望将它保存为gif文件或动画png,或者几个png文件以重新创建动画。
set yrange[-0.25:1.25];
plot 'transport000.dat' u 1:2 w l, 'transport000.dat' u 1:11 w lp;
pause -1;
plot 'transport001.dat' u 1:2 w l, &
我正在解钟摆的运动方程,我需要在GNUplot中创建一个动画来显示系统的发展。R4K逐点提供解决方案,该解决方案存储在第2和第3列中名为'd‘的.dat文件中。
set xrange [-2:2]
set yrange [-2:2]
set pointsize 2
set style line 2 lc rgb '#0060ad' pt 7
set object circle at first 0,0 size scr 0.01 \
fillcolor rgb 'black’ fillstyle solid
我的gnuplot命令在我的C++程序中不起作用。我试图在C++程序中运行gnuplot命令,如下所示:
system("gnuplot");
它给出了错误:
'gnuplot' is not recognized as an internal or external command. etc.
当我试图在cmd中运行gnuplot时,它工作得很好。
有谁知道为什么gnuplot命令不能在C++中使用C++函数呢?
我在bash上编写了一些脚本,以便使用gnuplot绘制数据。但它不起作用。
我有一个向命令行抛出数据的程序。我将数据收集到一个文件中,然后循环此过程以获得所需的结果。假设我有这个脚本
N = 10
./program.exe > data_$N.dat # Creating the data to be plotted
for ((i = 0 ; i<1 ; i++)) do # Dummy loop to throw all together to gnuplot
echo "set size square"
echo "set xrang
我想要定义gnuplot,它是一个png file.how,用于在gnuplot上定义fileName。
#This lines and also Traffic$j are define on my bash file.
# Traffic$j is the name of file and that is valid. Traffic$j is on the loop
# j is loop index
.
.
fileName=Traffic$j
.
.
我试试看:
gnuplot -e "filename=${!fileName}" p
我想使用这里的文档在bash脚本中存储gnuplot的配置文件,但是我需要能够在保留回车的同时替换bash变量。
如果我正在使用的内容的摘录如下:
read -r -d '' GNUPLOT_CONF << 'EOF'
set terminal pngcairo enhanced font 'Verdana, 10'
set title "This is a test"
set xrange [$SMALLEST:$LARGEST]
EOF
如果我
echo $GNUPLOT_CONF
然后变量得到正确的替换,
我的问题是我不能用我的c程序绘制一个图形。
当我搜索StackOverflow和google时,我得到了这样的声明:
system("gnuplot -p -e \"plot 'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder (3)/myfile.txt'\"");
但问题是终端上写着Gnuplot is not recognised as internal or external command.
//启动程序
#include <stdio.h>
#include <co
我在通过GNUplot传递JavaPlot参数时遇到了困难。我已经能够在几个不同的图形中使用JavaPlot,但我似乎无法让JavaPlot激活GNUPlot中的“极性”设置。
要更改为极性模式的GNUPlot命令只是“设置极性”。据我所知,我可能需要给.set(“极地”)命令一些PropertyHolder对象的JavaPlot。但哪一个目标呢?
直觉上,我会尝试(在创建了一个名为png的图像终端之后):
GNUPlotParameters params = new GNUPlotParameters();
params.set("polar");
G
我已经安装了带有RubyInstaller和DevKit的Ruby1.9.3。我安装了我期待使用的必要gem,但无论我做什么,我都不能让它工作。我运行我的程序,得到以下运行时错误:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/gnuplot-2.6.2/lib/gnuplot.r
b:59:in `gnuplot': gnuplot executable not found on path (RuntimeError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gem
我试图使用gnuplot绘制bash数组,而不将数组转储到临时文件中。
让我们说:
myarray=$(seq 1 5)
我尝试了以下几点:
myarray=$(seq 1 5)
gnuplot -p <<< "plot $myarray"
我得到了以下错误:
line 0: warning: Cannot find or open file "1"
line 0: No data in plot
gnuplot> 2
^
line 0: invalid com