2015-09-06 23 views
-2

当我在gnuplot中加载一个仅包含第一个绘图说明的文件(请参见下文)或仅包含第二个绘图说明的文件时,我没有任何错误。 但是,将两组指令组合在一个文件中(这样我可以叠加图),我有这个gnuplot错误消息:其中myFile.gnu具有下面的全部内容FIRST PLOT + SECOND PLOT。我不能将这两个图叠加在一起

我无法找到第一个图的哪个选项与第二个图相冲突。任何想法 ?

# FIRST PLOT 
set term x11 size 700,700 
set autoscale 
unset log 
set size square 1,1 
set grid 
set autoscale fix 
set title 'Free Energy (kcal/mol)' 
set xlabel 'phi' 
set ylabel 'psi' 
unset key 
set cblabel 
set cntrparam levels incr 0,2,20 
set pm3d map interpolate 1,1 
set style increment userstyles 
load 'analysis/RdYlBu.pal' 
set contour 
set style line 1 lc rgb "dark-blue" 
unset clabel 
set dgrid3d 
splot 'file.dat' u 1:2:3 lc rgb 'black' 

# SECOND PLOT 
set parametric 
set trange [-pi:pi] 
x1(t)=-1.3+1.5*cos(t) 
y1(t)=1.5+0.9*sin(t) 
replot x1(t),y1(t) 
theta1=2.2 
replot x1(t)*cos(theta1)-y1(t)*sin(theta1)-1.55,x1(t)*sin(theta1)+y1(t)*cos(theta1)+3.75 title 'ellipse1' 
x2(t)=1+0.4*cos(t) 
y2(t)=-0.7+0.8*sin(t) 
replot x2(t),y2(t) 
theta2=0 
replot x2(t)*cos(theta2)-y2(t)*sin(theta2)+0.2,x2(t)*sin(theta2)+y2(t)*cos(theta2)-0.7 title 'ellipse2' 
+0

你的第一个文件执行一个'splot',使'replot'在第二个文件还称之为“splot”。并且该命令在参数模式下将'u'和'v'识别为虚拟变量。 – Christoph

+0

我把u,v代替了我创建的所有函数,但是我得到了一个'参数函数没有完全指定'的错误。 – dada

+0

Becausr'splot'需要参数化模式下的三个功能 – Christoph

回答

0

还没有尝试过,但这种想法可以工作。做:

set multiplot 

上面的第一个脚本。第一个脚本后,追加

unset 
所有 set S的

。在此之下,追加:

set origin 0,0 
set size 1,1 

并在此之下,追加第二个脚本。然后追加

set multiplot 

(不是answear,我知道,但woulden't是一个美丽的评论)

相关问题