set terminal epslatex standalone color
set output 'temple.tex'#临时的tex文件
set xrange [-10 to 10]
set key top Right reverse vertical Left box #spacing 2
set size 0.8, 0.8
set xlabel '$x$'
set ylabel '$\sin(x)$'
set label 1 '$\int \cos(x) dx$ ' at 4, 0.2 tc lt 3
set xtics out nomirror #是坐标的刻度朝外
set ytics out nomirror
plot sin(x) lw 2 lt 1 title 'sin(x)' with lines
set output
!latex temple.tex && dvips -E -o xxx.eps temple.dvi #生成eps文件
!gsview32 xxx.eps #查看eps文件