我试图在一张图上绘制多个XRD图形,在它们之间有一个垂直偏移。例如,文件名为E65.xy
目前,这项工作是:
reset
set xlabel "2 Theta"
set ylabel "Intensity"
set xrange [5:60]
set key outside right
set border 3
set xtics nomirror
set ytics nomirror
set terminal pdf color font 'times new roman,17'
set output "XRD_E65.pdf"
offset = 400
plot 'E58.xy' using 1:($2 + offset*5) with lines ls 1 lc 1 title "E58 XRD" , \
'E59.xy' using 1:($2 + offset*4) with lines ls 1 lc 2 title "E59 XRD" , \
'E61.xy' using 1:($2 + offset*3) with lines ls 1 lc 3 title "E61 XRD" , \
'E62.xy' using 1:($2 + offset*2) with lines ls 1 lc 4 title "E62 XRD" , \
'E64.xy' using 1:($2 + offset*1) with lines ls 1 lc 5 title "E64 XRD" , \
'E65.xy' using 1:($2 + offset*0) with lines ls 1 lc 6 title "E65 XRD"
我有很多要画的,所以我试着用循环。我已经走了这么远:
offset = 400
explist = "58 59 61 62 64 65"
plot for [exp in explist] "E".exp.".xy" using 1:($2 + offset * (count) ) with lines title "E".exp
把所有六种图案都画在一起。我一直想在第一个for [count=1:6]
参数之后添加for
,“但是当我这样做的时候,我得到了36个样地(6组被400抵消)。
我想我理解为什么会发生这种情况,但我无法找到解决办法。
发布于 2015-07-09 18:54:30
通过添加for [count=1:6]
,您实际上创建了一个嵌套循环,从而绘制了偏移量和exp值的所有可能组合。
你应该考虑以下选择:
offsetlist = "5 4 3 2 1 0"
explist = "58 59 61 62 64 65"
plot for [i=1:6] "E".word(explist, i).".xy" using 1:($2 + word(offsetlist, i)) w l title "E".word(explist, i)
https://stackoverflow.com/questions/31325804
复制相似问题