data and scripts in one file/ 데이터랑 스크립트 한 파일 안에 넣고 그래프 그리기.

– data in the same file with script
– plot dots and plot fitting line together

 

 

– In the script file –

unset label  
set title "p-type Hall volatge as a function of the current" 
set xlabel "current[mA]" 
set ylabel "U_H[mV]" 
set label "B [mT] = 250\n T [K] = 298.15 \n f(x) =  a*x + b \n a:1.65593+/- 0.01821(1.1%)\n b:-2.06154 +/- 0.3407 (16.52%) \n rms of residuals: 1.22829" at -30,40 
f(x) = a*x + b 
fit f(x) '-' u 1:2 via a, b 
-30    -50.6    0.5    0.05 
-25    -42.7    0.5    0.05 
-20    -34.5    0.5    0.05 
-15    -26.5    0.5    0.05 
-10    -19.6    0.5    0.05 
-5    -12.2    0.5    0.05 
0    -4.7    0.5    0.05 
5    6.1    0.5    0.05 
10    14.6    0.5    0.05 
15    23.1    0.5    0.05 
20    32.6    0.5    0.05 
25    39.7    0.5    0.05 
30    47.9    0.5    0.05 

e 
plot '-' u 1:2:3:4  title " "with xyerrorbars , f(x) 
-30    -50.6    0.5    0.05 
-25    -42.7    0.5    0.05 
-20    -34.5    0.5    0.05 
-15    -26.5    0.5    0.05 
-10    -19.6    0.5    0.05 
-5    -12.2    0.5    0.05 
0    -4.7    0.5    0.05 
5    6.1    0.5    0.05 
10    14.6    0.5    0.05 
15    23.1    0.5    0.05 
20    32.6    0.5    0.05 
25    39.7    0.5    0.05 
30    47.9    0.5    0.05 

 

 

unset label  
set yrange [-1:1] 
set title "sameple voltage as changing temperature" 
set xlabel "(1/T)*1000[(1/K)/(1000/K)]" 
set ylabel "ln(1/U_p)[ln(1/V)]" 
set label "I(mA)=30    B(mT)=0 \n error of volage is 0.0005V" at 2.8,0.3 
set label "f1(x) =  a*x + b \n a =-4.08016+/- 0.2326(5.701%) \n b = 10.6004+/- 0.5911(5.576%)\n r = 0.039730" at 2.8,0.8 

f1(x) = a*x +b 
fit f1(x) '-' u 1:2 via a, b 
2.6798874447    -0.3023243492    4.01E-05    0.000294118 
2.5763235862    0.0377018672    3.79E-05    0.000326371 
2.4804663277    0.4748151862    3.59E-05    0.000389408 
2.4204284158    0.7486598905    3.59E-05    0.000389408 
e 

plot  '-' using 1:2:3:4  title " "with xyerrorbars, f1(x) 
3.3540164347    -0.3597701488    5.44E-05    0.000343407 
3.1933578157    -0.4542552723    5.10E-05    0.00032175 
3.0473868658    -0.5370779949    4.79E-05    0.000303767 
2.9141774734    -0.5838901946    4.50E-05    0.00029036 
2.7921262041    -0.5318040302    4.25E-05    0.000285063 
2.6798874447    -0.3023243492    4.01E-05    0.000294118 
2.5763235862    0.0377018672    3.79E-05    0.000326371 
2.4804663277    0.4748151862    3.59E-05    0.000389408 
2.4204284158    0.7486598905    3.59E-05    0.000389408

Leave a Reply