관심있는 것들 정리

graph 저장 및 불러오기 본문

programming/Gnuplot

graph 저장 및 불러오기

내공강화 2012. 3. 11. 21:13
작성한 graph를 파일로 저장해 두고 다시 불러와서 사용하고 싶다면
save 및 load 명령을 이용해서 저장 및 불러오기를 수행할 수 있다.

앞에서 예제로 사용한 

   plot "E:\cycles.txt" title "elapsed cycle" with line
  
 
그래프를 파일로 저장하기 위해 다음과 같이 명령을 준다.

  save "mygraph.gp"

그 후 저장된 파일을 불러오기 위해 다음과 같이 명령을 준다.

  load "mygraph.gp"

저장된 그래프가 그대로 불러오기 수행되는 것을 볼 수 있다.

저장된 파일을 살펴보면 gnuplot이 시작될 때 설정되는
기본 설정 데이터와 함께 마지막에 작성한 내용들이 저장되는 것을
확인 할 수 있다.

#!/gnuplot

#

#    

#     G N U P L O T

#     Version 4.4 patchlevel 4

#     last modified November 2011

#     System: MS-Windows 32 bit 

#    

#     Copyright (C) 1986-1993, 1998, 2004, 2007-2011

#     Thomas Williams, Colin Kelley and many others

#    

#     gnuplot home:     http://www.gnuplot.info

#     faq, bugs, etc:   type "help seeking-assistance"

#     immediate help:   type "help"

#     plot window:      hit 'h'

# set terminal wxt 0

# set output

unset clip points

set clip one

unset clip two

set bar 1.000000 front

set border 31 front linetype -1 linewidth 1.000

set xdata

set ydata

set zdata

set x2data

set y2data

set timefmt x "%d/%m/%y,%H:%M"

set timefmt y "%d/%m/%y,%H:%M"

set timefmt z "%d/%m/%y,%H:%M"

set timefmt x2 "%d/%m/%y,%H:%M"

set timefmt y2 "%d/%m/%y,%H:%M"

set timefmt cb "%d/%m/%y,%H:%M"

set boxwidth

set style fill  empty border

set style rectangle back fc lt -3 fillstyle   solid 1.00 border lt -1

set style circle radius graph 0.02, first 0, 0 

set dummy x,y

set format x "% g"

set format y "% g"

set format x2 "% g"

set format y2 "% g"

set format z "% g"

set format cb "% g"

set angles radians

unset grid

set key title ""

set key inside right top vertical Right noreverse enhanced autotitles nobox

set key noinvert samplen 4 spacing 1 width 0 height 0 

set key maxcolumns 0 maxrows 0

unset label

unset arrow

set style increment default

unset style line

unset style arrow

set style histogram clustered gap 2 title  offset character 0, 0, 0

unset logscale

set offsets 0, 0, 0, 0

set pointsize 1

set pointintervalbox 1

set encoding default

unset polar

unset parametric

unset decimalsign

set view 60, 30, 1, 1

set samples 100, 100

set isosamples 10, 10

set surface

unset contour

set clabel '%8.3g'

set mapping cartesian

set datafile separator whitespace

unset hidden3d

set cntrparam order 4

set cntrparam linear

set cntrparam levels auto 5

set cntrparam points 5

set size ratio 0 1,1

set origin 0,0

set style data points

set style function lines

set xzeroaxis linetype -2 linewidth 1.000

set yzeroaxis linetype -2 linewidth 1.000

set zzeroaxis linetype -2 linewidth 1.000

set x2zeroaxis linetype -2 linewidth 1.000

set y2zeroaxis linetype -2 linewidth 1.000

set ticslevel 0.5

set mxtics default

set mytics default

set mztics default

set mx2tics default

set my2tics default

set mcbtics default

set xtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0

set xtics autofreq  norangelimit

set ytics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0

set ytics autofreq  norangelimit

set ztics border in scale 1,0.5 nomirror norotate  offset character 0, 0, 0

set ztics autofreq  norangelimit

set nox2tics

set noy2tics

set cbtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0

set cbtics autofreq  norangelimit

set title "" 

set title  offset character 0, 0, 0 font "" norotate

set timestamp bottom 

set timestamp "" 

set timestamp  offset character 0, 0, 0 font "" norotate

set rrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )

set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )

set urange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )

set vrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )

set xlabel "" 

set xlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate

set x2label "" 

set x2label  offset character 0, 0, 0 font "" textcolor lt -1 norotate

set xrange [ * : * ] noreverse nowriteback  # (currently [1000.00:5000.00] )

set x2range [ * : * ] noreverse nowriteback  # (currently [1000.00:5000.00] )

set ylabel "" 

set ylabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270

set y2label "" 

set y2label  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270

set yrange [ * : * ] noreverse nowriteback  # (currently [1.00000e+008:6.50000e+008] )

set y2range [ * : * ] noreverse nowriteback  # (currently [1.24123e+008:6.12432e+008] )

set zlabel "" 

set zlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate

set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )

set cblabel "" 

set cblabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270

set cbrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )

set zero 1e-008

set lmargin  -1

set bmargin  -1

set rmargin  -1

set tmargin  -1

set locale "Korean_Korea.949"

set pm3d explicit at s

set pm3d scansautomatic

set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean

set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB 

set palette rgbformulae 7, 5, 15

set colorbox default

set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault

set loadpath 

set fontpath 

set fit noerrorvariables

GNUTERM = "wxt"

plot "E:\cycles.txt" title "elapsed cycle" with line

#    EOF

 
반응형