我正在尝试使用gnuplot v4.2设置wxt终端窗口的大小
gnuplot> set terminal wxt size 600,600
Terminal type set to 'wxt'
undefined variable: size
Run Code Online (Sandbox Code Playgroud)
更令人沮丧的是,wxt -geometry不像x11终端那样尊重旗帜.注意:我已经尝试过600,800,600x800两者都不起作用.
% gnuplot --version
gnuplot 4.2 patchlevel 4
Run Code Online (Sandbox Code Playgroud) 我知道对于4d彩色图(3d表面,颜色由第4个字段给出),我可以使用格式的数据文件
# X Y Z C
1 1 0 4
1 2 1 3
2 1 4 2
2 2 4 5
...
Run Code Online (Sandbox Code Playgroud)
然后使用
set pm3d
splot "datafile.dat" u 1:2:3:4 with pm3d
Run Code Online (Sandbox Code Playgroud)
另一方面,我知道如何制作一个简单的曲面图,其中X和Y值是隐式的,而Z值是矩阵格式:
#Z DATA ONLY
0 1
4 4
splot "datafile.dat" matrix
Run Code Online (Sandbox Code Playgroud)
有没有办法用这种矩阵格式制作4d彩色图?例如,从一个文件中获取Z数据和从另一个文件中获取相应的颜色数据,或者将Z值和颜色组合成矩阵格式的单个文件?
我是gnuplot的新手,在绘制堆积直方图时,我发现传说隐藏在数据背后.
有没有方法将图例放在数据上方?非常感谢你的帮助.编辑:我目前正在使用外部底部的设置键将图例放在外面,但这不是我想要的最佳解决方案.
我有从0到100的yaxis.我想要每10个单位后有一个网格线.我怎样才能做到这一点?也就是说,如何在每10个单位后绘制网格线?
我正在使用gnuplot脚本
#qe.conf
set terminal png truecolor
set output "qe.png"
set xrange ["400" : "700"]
set yrange ["0" : "1"]
set style data lines
plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R"
Run Code Online (Sandbox Code Playgroud)
我正在通过shell脚本执行gnuplot脚本qe.conf它给了我以下错误
gnuplot>情节"qe.txt"使用1:2标题"%Red",''使用1:3标题"%Gr",''使用1:4标题"%Gb",''使用1:5标题" %R"^第0行:警告:跳过没有有效点的数据文件
gnuplot>情节"qe.txt"使用1:2标题"%Red",''使用1:3标题"%Gr",''使用1:4标题"%Gb",''使用1:5标题" %R"^第0行:警告:跳过没有有效点的数据文件
gnuplot>情节"qe.txt"使用1:2标题"%Red",''使用1:3标题"%Gr",''使用1:4标题"%Gb",''使用1:5标题" %R"^第0行:警告:跳过没有有效点的数据文件
gnuplot>情节"qe.txt"使用1:2标题"%Red",''使用1:3标题"%Gr",''使用1:4标题"%Gb",''使用1:5标题" %R"^第0行:警告:跳过没有有效点的数据文件
但是当我手动执行qe.conf时,我工作正常
数据文件在这里.
400.0 0.3625060772
410.0 0.445987595886
420.0 0.503862994331
430.0 0.534251869841
440.0 0.576047041939
450.0 0.594211326218
460.0 0.58079588866
470.0 0.506666961836
480.0 0.495652452097
490.0 0.426107864611
500.0 0.342632041157
510.0 0.251232093174
520.0 …Run Code Online (Sandbox Code Playgroud) 我有一个很长的gnuplot脚本.出于调试目的,我希望能够阻止此脚本的注释部分或使用"goto"语句.这可能吗?
我知道我可以用一个if声明:
if (1 == 2) {
commented-out-code
} else {
non-commented-out code
}
Run Code Online (Sandbox Code Playgroud)
这是唯一的解决方案吗?
我可以用Gnuplot 5.0绘制平行坐标图.例如:
plot "ranking_top10.dat" using 4:5:6:7:8:2 with parallel lt 1 lc variable
Run Code Online (Sandbox Code Playgroud)
将绘制5个轴和不同颜色的线条.但是,我想将键与每个行关联起来.例如,我想将一个键(字符串)与紫色线相关联,并在图中显示它.怎么做?
如何在具有这种数据结构的Gnuplot中绘制(2D绘图)矩阵,使用第一行和列作为ax和y ticks(第一行的第一个数字是列数)并表示其余值通过颜色映射,可以在2D平面上看到它?
4 0.5 0.6 0.7 0.8
1 -6.20 -6.35 -6.59 -6.02
2 -6.39 -6.52 -6.31 -6.00
3 -6.36 -6.48 -6.15 -5.90
4 -5.79 -5.91 -5.87 -5.46
Run Code Online (Sandbox Code Playgroud) 在使用PDL :: Graphics :: Gnuplot绘制数据时,我遇到了一个奇怪的效果.看来,一次只绘制有限数量的点replot.
考虑以下示例(15行,101分):
use strict;
use warnings;
use PDL;
use PDL::Graphics::Gnuplot qw/gpwin/;
my $win = gpwin('qt', persist => 1);
foreach my $a (1..15) {
my $x = sequence(101)/100;
my $y = $a*$x;
if ($a == 1) {
$win->plot({ linecolor => 'black' }, $x, $y);
}
else {
$win->replot({ linecolor => 'black' }, $x, $y);
}
}
Run Code Online (Sandbox Code Playgroud)
最后只使用21个点,显示所有15行.
首先,我认为只绘制了有限数量的线,但这不是真的,因为绘制线的数量取决于piddles的大小.
这是perl模块或Gnuplot的限制吗?有没有办法增加最大点数?这似乎是Gnuplots qt版本的问题.使用'x11'as终端不显示此限制(我测试了100行,101点没有任何问题).
此外,我测试相同的例子而不使用replot但是在一个单独的plot.
use strict;
use warnings;
use PDL; …Run Code Online (Sandbox Code Playgroud) 我的数据文件是一组围绕轴原点的(x,y,z)点.它们代表一种措施失败的点.这些要点在此链接中.
Gnuplot可以绘制它们,
set encoding iso_8859_1
set term postscript eps enhanced color size 4.7in,4in
set xlabel "X"
set ylabel "Y"
set zlabel "Z"
set output "test_gp.eps"
set style line 1 lc rgb '#0060ad' pt 7 ps 0.5 lt 1 lw 0.5 # --- blue
set style fill transparent solid 0.15 noborder
splot "data.dat" u 1:2:3 w p ls 1 title "P_{error}"
Run Code Online (Sandbox Code Playgroud)
由此产生的情节
问题是该图未显示更可能发生错误的位置.如果可能的话,我想展示点密度的变化.
我不知道是否可以改变点的颜色或给它们透明度,并尝试用最密集的点来表示位置.
如果3D点的密度的表示是不可能的,另一种方式可以是,使点的投影密度在三个平面(X = 0,Y,Z),(X,Y = 0,Z),( X,Y,Z = 0).
问候
编辑:
我可以用不同的颜色绘制我的实验的success(0)和error(1)点位置.此 …