일반물리실험 때 썼던 gnuplot을 (전공)물리 실험 레포트를 쓰기 위해 다시 쓰려했더니!!
얼마나 되었다고 벌써 까마득 하다. 역시 사람은 기록을 잘 해놔야 해!!\.\
그래서 될 수 있는 데로 써 놓자!!
내가 쓰는 건, gnuplot 4.6 window용이다.
리눅스가 익숙해 져야 이런 프로그램들을 리눅스에서 다룰 텐데 ㅠㅠ
게으름과 멍청함으로 아직 윈도우에서 머무르고 있다.
Gnuplot, latex 이런 것들은 리눅스 기반? 이기 때문에 linux용 설명이 항상 풍부한데 반해 window 용 설명은 좀 부족하다.
나중에 또 찾기 힘드니까 여기에 다~~ 기록 할 수 있었으면 좋겠다.
Start!!
Gnuplot 을 깔고 실행시키면 다음과 같은 창이 뜬다.
제대로 설명을 하려면 아주 기본적인 스크립트부터 시작해야 하지만,
설명보다는 기록에 목적이 있기 때문에
간결하고 대충(?) 써 놓으려 한다.
(단순 기록이라면 이렇게 사설이 길 필요도 없었는데.. ㅋㅋ 몰겠당)
gnuplot> show loadpath
Gnuplot과 연결된 파일 경로를 보여 준다.
나의 파일 경로에는 파일을 저장할 수 없었다. 엑세스가 거부된다고 떴다.
나의 파일 경로를 따로 만들 필요가 있었다.
gnuplot> set loadpath "C:\\Users\\USER\\Desktop\\gnuplot" gnuplot> show loadpath loadpath is "C:\Users\USER\Desktop\gnuplot" loadpath from GNUPLOT_LIB is "C:\Program Files(x86)\gnuplot\demo" gnuplotrc is read from share
바탕화면 gnuplot이라는 파일이 loadpath 로 지정 되었다.
Gnuplot 폴더에 내용이 plot sin(x) 인 test.txt파일을 만들었다.
gnuplot> load "test.txt"
sin 그래프가 나타나는 것을 쉽게 볼 수 있을 것이다.
그래프를 저장하기 위해서는,
gnuplot> set terminal png Terminal type set to 'png' Options are 'nocrop font "arial,12" fontscale 1.0 size 640,480 ' gnuplot> set output "C:\\Users\\USER\\Desktop\\gnuplot\\test.png" gnuplot> replot
Gnuplot 폴더에 파일을 확인 해 볼 수 있다.
오늘 한 결과들
set title "e/m[C/kg] with worst case of adding uncertainties" set xlabel "voltage[V]" set ylabel "measurement e/m[C/kg]" #script 2*standard derivation plot [100:240] '-' using 1:2:5 title "r=0.019" with yerrorbars, \ '-' using 1:2:5 title "r=0.295" with yerrorbars,\ '-' using 1:2:5 title "r=0.04" with yerrorbars, \ '-' using 1:2:5 title "r=0.05" with yerrorbars,\ 1.75588E+11 title "theoritical value" #set terminal png #set output "C:\\Users\\USER\\Desktop\\gnuplot\\e/m[C/kg] with worst case of adding uncertainties.png" 119.9 1.81264E+11 1885866928 3771733855 6848340285 140.4 1.7771E+11 1885866928 3771733855 6713979812 160.6 1.83247E+11 1885866928 3771733855 6923061765 180.1 1.80967E+11 1885866928 3771733855 6836882366 200.9 1.79127E+11 1885866928 3771733855 6767321493 220.5 1.82463E+11 1885866928 3771733855 6893328484 EOF 119.9 1.90149E+11 5385243100 10770486201 4723079837 140.9 1.73616E+11 5385243100 10770486201 4312190404 160.2 1.82143E+11 5385243100 10770486201 4523851177 180.7 1.81233E+11 5385243100 10770486201 4501146741 200.8 1.77745E+11 5385243100 10770486201 4414455072 220.1 1.7563E+11 5385243100 10770486201 4361863360 EOF 119.9 2.31105E+11 21589919917 43179839834 4354505631 140.3 1.93235E+11 21589919917 43179839834 3640685867 160.6 1.81056E+11 21589919917 43179839834 3411104443 180.6 1.79937E+11 21589919917 43179839834 3389964536 200.5 1.74548E+11 21589919917 43179839834 3288382606 220.7 1.63073E+11 21589919917 43179839834 3072151745 EOF 119.9 2.28741E+11 17958593709 35917187417 3562967667 140.3 1.97008E+11 17958593709 35917187417 3067913812 160.1 1.87698E+11 17958593709 35917187417 2922538335 180.6 1.8083E+11 17958593709 35917187417 2815325553 200.8 1.77515E+11 17958593709 35917187417 2763537642 220 1.77573E+11 17958593709 35917187417 2764321725 EOF

set title "e/m[C/kg] at each radius" set xlabel "radius[m]" set ylabel "measurement e/m[C/kg]" plot [0:0.06] '-' using 1:2:($3*3) title "using 3 x standard derivation" with yerrorbars,\ 1.75588E+11 title "theoritical value" 0.019 1.80796E+11 1885866928 0.0295 1.80086E+11 5385243100 0.04 1.87159E+11 21589919917 0.05 1.91561E+11 17958593709
set title "wavelength / voltage " set xlabel "Lattice plane spacings in graphite d1&d2" set ylabel "measured wavelength / voltage[m/V]" set xtics (1,2) set format y "%.2t*10^%+03T" #script 2*standard derivation plot [0:3] '-' using 1:2:($3*3) title "" with yerrorbars, \ 1.22632E-09 title "theoritical value" 1 1.27849E-09 2.34947E-11 2 1.27237E-09 1.24123E-10