2013-06-18 4 views
3

gnuplot.My 데이터 세트는 다음과 같이 보입니다.gnuplot의 x 축 값

1  0.530000 0.510000 
2  0.420000 0.310000 
4  0.400000 0.160000 
8  0.390000 0.070000 
16 0.390000 0.040000 
32 0.310000 0.020000 
64 0.170000 0.020000 
128 0.070000 0.000000 
256 0.030000 0.000000 
512 0.020000 0.000000 
1024 0.000000 0.000000 

내 gnuplot 파일은 다음과 같습니다.

#!/usr/bin/gnuplot 
reset 
set terminal png 

set ylabel "time in ms" 

set xlabel "k" 

set title "update every kth element" 
set key reverse Left outside 
set grid 

set style data linespoints 

set output 'cache_access.png' 
plot "time_mem_access.dat" using 1:2 title "cache access 1", \ 
     ""     using 1:3 title "cache access 2" 

내가 가진 그래프는 다음과 같습니다.

enter image description here

내 문제는 내가 정확히 어떻게이 완료 얻기 위해 x 축 나는에있는 모든 문서를 온라인으로 찾을 수 없습니다

i.e 1,2,4,8,16,32,64 etc. 

첫 번째 열에서 정확한 값을 표시 할 것입니다 . 를 호출하는 대신

답변

13

:

plot "time_mem_access.dat" using 1:2 title "cache access 1", \ 
     ""     using 1:3 title "cache access 2" 

당신은 시도 할 수 있습니다 :

plot "time_mem_access.dat" using 1:2:xtic(1) title "cache access 1", \ 
     ""     using 1:3:xtic(1) title "cache access 2" 

당신에게 다음과 같은 플롯 줄 것이다 : 당신은 할 수 있습니다 그러나 enter image description here

이의 로그를 취할를 x 값 :

plot "time_mem_access.dat" using (log($1)):2:xtic(1) title "cache access 1", \ 
     ""     using (log($1)):3:xtic(1) title "cache access 2" 

다음 중 어느 것이겠습니까? enter image description here