import font in Gnuplot: strange result -


i using fontfile option import font in gnuplot. font selected similar computer modern font, obtain different font. here code

reset  set term postscript enhanced eps fontfile "/usr/share/texmf/fonts/type1/public/lm/lmr8.pfb" "lmr8" set output "comparison_inside_fields.eps" set key spacing 1.5 normtemp=2*pi*750*1e+12  set xlabel "{/lmr8=20 t} ({/lmr8=18 s})" set ylabel "re({/lmr8=18 e}_{/lmr8=12 1}) ({/lmr8=18 v/m})" font "lmr8,17"  set logscale y set yrange [50:1000] set size 0.65 set tics front set autoscale xfixmax   plot "analytic_efield_linear_pw1000.dat" u ($1/normtemp):($2) w l lw 3.0 lc rgb "red" title "e_{1} equa-diff", "efield_linear_pw1000.txt" u ($1):($2) w l lw 3.0 lc rgb "blue" title "e_{1} cst", "exponential_linear.dat" u ($1/normtemp):($2) w l lt 2 lw 1.0 lc rgb "black" notitle` 

and here image:

enter image description here

the font name lmroman8, , not lmr8. use e.g. kfontview or head -1 .../lmr8.pfb see font name.

so rather minimal example taken script be:

reset  set term postscript enhanced eps fontfile "/usr/share/texmf/fonts/type1/public/lm/lmr8.pfb" "lmroman8" set output "comparison_inside_fields.eps"  set xlabel "{/lmroman8=20 t} ({/lmroman8=18 s})" set ylabel "re({/lmroman8=18 e}_{/lmroman8=12 1}) ({/lmroman8=18 v/m})" font "lmroman8,17" plot x title "e_{1} equa-diff" 

result 4.6.5 is:

enter image description here

the result ok, recommend use epslatex terminal, provides nicer typesetting. here examplary document similar yours:

basename = 'epslatex-test' set terminal epslatex standalone header '\usepackage{lmodern}' set output basename.'.tex'  set xlabel '$t$ (s)' set ylabel 're$(e_1)$ (v/m)' offset 1 plot x  set output system(sprintf('latex %s.tex && dvips %s.dvi && ps2pdf %s.ps && pdfcrop --margins 1 %s.pdf %s.pdf',\        basename, basename, basename, basename, basename)) 

enter image description here

instead of using header option can write packages , settings want image file gnuplot.cfg, included automatically, if available.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -