2011-08-01 2 views
0

나는 .eps 파일을 생성하기 위해 gnuplot 스크립트를 만들고 실행하기 위해 PHP 스크립트를 만들었습니다. 그들은 서로 다른 축과 값을 가진 그래프이지만 크기는 정적으로 유지됩니다.두 개의 서로 다른 그래프 크기를 생성하는 Gnuplot 스크립트

많은 gnuplot 경험을 가진 사람이 생성 된 그래프가 크기 매개 변수를 고의적으로 설정해도 동일한 크기로 유지되지 않는 이유를 알 수 있기를 바랍니다. 당신이 볼 수 있듯이, 크기 설정 http://i53.tinypic.com/2a7zrci.png

있습니다

#!/usr/bin/gnuplot 
set terminal postscript enhanced color font "/usr/share/fonts/DejaVuSans-Bold" 10 
set size ratio 0.72 
set output '/.../A.2.2.eps' 
set grid 

set key center bot 
set key out vertical 
set key horizontal center 
set key box 

set style line 1 linetype 1 linecolor rgb "red" linewidth 2.000 pointtype 6 pointsize default 
set style line 3 linetype 1 linecolor rgb "#DAA520" linewidth 2.000 pointtype 6 pointsize default 
set style line 4 linetype 1 linecolor rgb "#006400" linewidth 2.000 pointtype 6 pointsize default 
set style line 6 linetype 1 linecolor rgb "blue" linewidth 2.000 pointtype 6 pointsize default 

set multiplot 
set palette model RGB functions 0.8+gray/3, 0.8+gray/3, 0.8+gray/3 
set pm3d map 
set isosample 100,100 

unset colorbox 
unset border 
unset xtics 
unset ytics 
set nokey 
set nolabel 
set size 1.165,1.2 
set origin -0.045 ,-0.072 

splot y t ' ' 

set title "SECTION A.2.2 TEST RESULTS" 
set key box 
set key bottom center 
set y2tics 0 , 850 
set ytics nomirror 
set xtics nomirror 

set border 
set xtics("300" 0 , "600" 1 , "900" 2 , "1200" 3 , "2000" 4 , "2800" 5 , "3200" 6 , "4000" 7 , "4500" 8 , "5500" 9 , "6500" 10 , "7500" 11) 
set ytics 0 , 12000 

set size 1,1 
set xtics out offset -1,-1.5 
set xtics rotate by 45 

unset origin  
set x2tics("20" 0 , "100" 1 , "200" 2 , "50" 3 , "100" 4 , "100" 5 , "200" 6 , "100" 7 , "50" 8 , "100" 9 , "100" 10 , "200" 11) 
set x2range [ 0 : 11 ] 

set xlabel "Loop Length, 26AWG(ft)" 0,0.8 
set x2label "Bridge Tap Length, 24AWG (ft)" 0,0.8 
set ylabel "Downstream Data Rate (kbps)" 
set y2label "Upstream Data Rate (kbps)" 
set xrange [ 0 : 11 ] noreverse nowriteback 
set yrange [ 0 : 60000 ] noreverse nowriteback 
set y2range[ 0 : 8500 ] noreverse nowriteback 
set bmargin 7 

plot "EDS_A.2.2.txt" axes x1y1 ls 4 title 'Expected Downstream Rate' with linespoints, \ 
"DS_A.2.2.txt" axes x1y1 ls 1 title 'Measured Downstream Rate' with linespoints, \ 
\ 
"EUS_A.2.2.txt" axes x1y2 ls 6 title 'Expected Upstream Rate' with linespoints, \ 
"US_A.2.2.txt" axes x1y2 ls 3 title 'Measured Upstream Rate' with linespoints 

unset multiplot 

이 그래프에 관한 것으로서,이 코드 반면 http://i52.tinypic.com/34qu6c0.png

:

#!/usr/bin/gnuplot 
set terminal postscript enhanced color font "/usr/share/fonts/DejaVuSans-Bold" 10 
set size ratio 0.72 
set output '/.../A.2.1.eps' 
set grid 

set key center bot 
set key out vertical 
set key horizontal center 
set key box 

set style line 1 linetype 1 linecolor rgb "red" linewidth 2.000 pointtype 6 pointsize default 
set style line 3 linetype 1 linecolor rgb "#DAA520" linewidth 2.000 pointtype 6 pointsize default 
set style line 4 linetype 1 linecolor rgb "#006400" linewidth 2.000 pointtype 6 pointsize default 
set style line 6 linetype 1 linecolor rgb "blue" linewidth 2.000 pointtype 6 pointsize default 

set multiplot 
set palette model RGB functions 0.8+gray/3, 0.8+gray/3, 0.8+gray/3 
set pm3d map 
set isosample 100,100 

unset colorbox 
unset border 
unset xtics 
unset ytics 
set nokey 
set nolabel 
set size 1.165,1.2 
set origin -0.045 ,-0.072 

splot y t ' ' 

set title "SECTION A.2.1 TEST RESULTS" 
set key box 
set key bottom center 
set y2tics 0 , 800 
set ytics nomirror 
set xtics nomirror 

set border 
set xtics("300" 0 , "600" 1 , "900" 2 , "1200" 3 , "1600" 4 , "2000" 5 , "2400" 6 , "2800" 7 , "3200" 8 , "3600" 9 , "4000" 10 , "4500" 11 , "5500" 12 , "6500" 13 , "7500" 14 , "8500" 15) 
set ytics 0 , 11000 

set size 1,1 
set xtics out offset -1,-1.5 
set xtics rotate by 45 

unset origin  

set x2range [ 0 : 0 ] 

set xlabel "Loop Length, 26AWG(ft)" 0,0.8 

set ylabel "Downstream Data Rate (kbps)" 
set y2label "Upstream Data Rate (kbps)" 
set xrange [ 0 : 15 ] noreverse nowriteback 
set yrange [ 0 : 55000 ] noreverse nowriteback 
set y2range[ 0 : 8000 ] noreverse nowriteback 
set bmargin 7 

plot "EDS_A.2.1.txt" axes x1y1 ls 4 title 'Expected Downstream Rate' with linespoints, \ 
"DS_A.2.1.txt" axes x1y1 ls 1 title 'Measured Downstream Rate' with linespoints, \ 
\ 
"EUS_A.2.1.txt" axes x1y2 ls 6 title 'Expected Upstream Rate' with linespoints, \ 
"US_A.2.1.txt" axes x1y2 ls 3 title 'Measured Upstream Rate' with linespoints 

unset multiplot 

앞의 코드는이 그래프 관련 똑같다; 하나 이상에 다른 점이 있지만, 그래프가 그로 인해 축소되어야한다고 나는 생각하지 않습니다. 전에 말했듯이 수동으로 설정했습니다.

그래프의 정전을 용서하십시오. 잠재적으로 민감한 정보와 모든 좋은 것들.

편집 : 제안 된대로 세트 터미널 포스트 스크립트 크기 26cm, 18cm 을 추가했으며, 아무 것도 깨지 않았지만 이상한 불일치를 해결하지 못했습니다.

+0

크기를 기반으로 배경을 채우기 위해 그래디언트를 설정하는 방법도 효과가 있습니다. – Joshua

+0

두 그래프에서 동일한 레이블과 두 개의 제목 만 사용할 수 있습니까? – whoplisp

+0

다른 사용자가 발생하는 오류를 재현 할 수 있도록 최소한의 예를 설정하십시오. – Woltan

답변

0

다른 크기를 재현 할 수 없습니다. 어쩌면 문제를 재현 할 다른 데이터와 함께 문제의 최소한의 예를 게시하고 싶을 수도 있습니다.

set terminal postscript enhanced color 
set terminal postscript size 10cm, 12cm 

어쩌면이 같은 크기가 플롯을 생성하는 데 도움이됩니다

그러나, 포스트 스크립트 터미널에 대한 명시 적으로 예를 들어 같은 터미널에 대한 당신이 원하는 크기를 설정할 수 있습니다.

+0

괜찮 았어! 감사합니다. – Joshua

+0

거짓말했습니다. 작동하지 않았습니다. – Joshua

관련 문제