2013-05-20 48 views
0

我想繪製x值落在xtics之間的圖。x軸處的值落在xtics之間

例如,我希望我的xtics是

C72 C73 C74 C75 C76 C77 C78 C79 C80 C81

和點C72 C73之間下跌; C73 C74; C74 C75;等等。

我的數據點

> 2.5 0.17509 C72 
> 3.5 0.220434 C73 
> 4.5 0.164918 C74 
> 5.5 0.172477 C75 
> 6.5 0.156145 C76 
> 7.5 0.171699 C77 
> 8.5 0.165199 C78 
> 9.5 0.191207 C79 
> 10.5 0.211656 C80 
> 11.5 0.202233 C81 

我在腳本定義如下使用xticlabels():

#OUTPUT  
set terminal pngcairo size 650,450 enhanced dash 
set output "xplot_gauche_malto-thermo.png" 
set style line 4 lt 4 lw 10 # Please DISABLE pause -1 

#MICRO 
set macro 
labelFONT="font 'arial,22'" 
scaleFONT="font 'arial,18'" 
scaleFONT2="font 'arial,18'" 
keyFONT="font 'arial,18'" 

# AXIS DEFINITIONS 
set xrange [0:12] 
set yrange [0:0.8] 
set xtic (2,3,4,5,6,7,8,9,10,11)    @scaleFONT2 
set ytic          @scaleFONT      
set boxwidth 0.8 
set size square 

#PLOT 

plot "all_dihedrals_in_layers_malto.dat" using 1:2:xticlabels(3) with linespoints lw 2 linecolor rgb "black" pointtype 1 pointsize 2 title "" 

如果我使用的代碼如上,僅使用第1列獲得一個陰謀和2從數據文件(如上所述)我得到的點在2-3,3-4,4-5之間等等。

不幸的是,如果我使用「xticlabels()」,我沒有得到圖表,因爲我想在C72-C73,C73-C74,C74-C75等之間落入該點。

提前感謝您的幫助。 感謝

回答

1

嘗試這樣的事情..(未測試我沒有這臺機器上的gnuplot ..)

plot "all_dihedrals_in_layers_malto.dat" using 1:2 with linespoints \ 
     lw 2 linecolor rgb "black" pointtype 1 pointsize 2 title "" ,\ 
    "all_dihedrals_in_layers_malto.dat" using ($1-.5):0/0:xticlabels(3) 
當然

你可以輪流在所設定的xtics線標籤手動鍵..

編輯..有機會嘗試它,0/0或(0/0)不起作用。你需要做的是繪製一些超出範圍的值..例如:

set yrange [0:] 
plot "all_dihedrals_in_layers_malto.dat" using 1:2 with linespoints \ 
     lw 2 linecolor rgb "black" pointtype 1 pointsize 2 title "" ,\ 
    "all_dihedrals_in_layers_malto.dat" using ($1-.5):-1:xticlabels(3) notitle