我試圖疊加兩個柱狀圖,我需要第二個(藍色圖像中)是透明的,所以它下面的一個可以看出:gnuplot的 - 設置透明直方圖
這是我使用的代碼:
#!/bin/bash
gnuplot << EOF
set term postscript portrait color enhanced
set output 'test.ps'
set size ratio 1
set multiplot
set size 0.5,0.5
n=20 #number of intervals
max=1.0 #max value
min=0.0 #min value
width=(max-min)/n #interval width
hist(x,width)=width*floor(x/width)+width/2.0
set boxwidth width*0.9
set xrange [0:1]
plot "/path_to_file" u (hist(\$1,width)):(1.0) smooth freq w boxes lc rgb "black" lt 1 lw 0.5 notitle fs solid 0.5, \
"/path_to_file" u (hist(\$2,width)):(1.0) smooth freq w boxes notitle fs transparent pattern 4 noborder lc rgb "blue" lt 1 lw 0.5
EOF
下面是可以與上面的代碼中使用的文件:http://pastebin.com/5qpFHgtZ
而'awk'並不奇怪; ^) – mgilson
哈哈對不起。刪除了'awk'位,因爲它不是真的必需的,並且添加了一個數據文件。 – Gabriel
我認爲你在劇本中失去了一個「情節」。我給這個一杆,看看有什麼我可以用它做... – mgilson