我在Mac OS X v10.6.8上使用gnuplot 4.4 patchlevel 4。我正在运行一个gnuplot脚本,其简化版本如下:(在运行脚本之前在终端中指定了file1,file2,...等)
reset
set term aqua enhanced font "Times-Roman, 18"
set term aqua dashed
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\
file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\
file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\
file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\
file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\
file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\
file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\
file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\
file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\
file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF"
文件1-5是一个数据集,文件6-10是另一个数据集。我想用实线绘制文件1到5,用虚线绘制文件6到10。在水上航站楼有没有办法做到这一点?根据内置帮助,“可以绘制实线或虚线”。我看过多个常见问题和文档,但共识似乎是真的很难或不可能做到这一点?另外,有没有人知道关于aqua终端或gnuplot命令的任何综合文档?
编辑:要绘制文件6-10我一直使用lw 6来区分它们与1-5区别,因为我无法使虚线工作。我上面的脚本会正确地执行此操作吗?换句话说,脚本是否正在做我认为它正在做的事情? (绘制1-5条实线和6-8条较粗的线?)我问,因为在尝试制作虚线时,我将“lw 6”替换为“lt 2”。然而,这导致file5用虚线绘制,这很奇怪。
编辑2:我附上了我的终端测试图,似乎没有提到虚线?
编辑3:更新了脚本以反映所做的更改。
编辑4:图形现在是设定术语aqua增强字体“Times-Roman,18”虚线;测试
答案 0 :(得分:0)
实际上并不是太糟糕(至少在OS-X 10.5.8上我使用gnuplot 4.2。我停止在我的新版本的gnuplot中构建aquaterm,因为我不喜欢那个终端)在aqua终端中,线型1是实线,线型2是虚线。
set term aqua enhanced font "Times-Roman, 18" dashed
plot sin(x) w lines lt 1 lc rgb "blue", cos(x) w lines lt 2 lc rgb "purple"
要查看您的gnuplot版本将用于特定终端的线型,您可以在设置终端后使用test
命令(如果终端需要,则输出)。
关于代码外观的建议:
reset
set term aqua enhanced font "Times-Roman, 18" dashed
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\
file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\
file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\
file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\
file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\
file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\
file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\
file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\
file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\
file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF"
修改强>
我只是看着朋友的电脑。对于她(gnuplot 4.4.4,os-X 10.6?),linetype 8是第一个虚线类型(突出显示test
命令的用处)。