2017-02-16 70 views
0

我有下面的代碼,其生成疊加柱狀圖:GNUPLOT羣集在x範圍爲堆疊直方圖

#!/usr/bin/gnuplot 
set term postscript eps enhanced color 
#set output 'stacked-hist.eps' 
set output ARG1.'.eps' 

set title ARG1 
set key top left outside horizontal autotitle columnhead 

#set xtics rotate by 90 offset 0,-5 out nomirror 
set autoscale x 
set ytics out nomirror 

set style fill solid border -1 
set boxwidth 0.5 relative 
set style data histograms 
set style histogram rowstacked 
set xlabel "Degree of node" 

plot ARG1 using 2, '' using 3:xtic(1) 

這導致爲以下:(因爲x範圍爲0:5000) Stacked histogram for a long x-range

我想有是繼(在輸入數據時,我沒有每X很多個數據點,所以我想看看直方圖的集羣,如下圖所示: enter image description here

有沒有辦法在gnuplot中做到這一點? 這種疊加直方圖是否有正式名稱? (分組堆積直方圖)

+0

你能提供更多的信息嗎?目前還不清楚如何解釋您的示例圖,因此不清楚如何重現它。 200

+0

可能有200到1000之間的一些數據點,但我想忽略它們。在gnuplot中可能嗎? – Trojosh

回答

0

從您對我評論的回答中,聽起來好像您只是想跳過某些數字以下的值。如果這是你所需要的,那很簡單。首先,讓我們做一個隨機數表,做它的一個直方圖(我將跳過風格設置,但我用你的):

set table set out 'rand.dat' plot rand(0) unset table plot 'rand.dat'

這給了我們這樣的:

Normal histogram plot

如果我們想跳過繪製直方圖盒低於一定值值,說0.4,我們只要做到這一點:

c = 0.4 plot 'rand.dat' using ($2 > c ? $2 : NaN)

這會讓我們這樣的:

Histogram with gaps

如果我還是不明白你想要做什麼,對不起。隨時啓發我,我會再試一次。