Showing posts with label gnuplot. Show all posts
Showing posts with label gnuplot. Show all posts

Tuesday, 27 March 2012

Padding for superscript and subscript axis labels in gnuplot

By default gnuplot doesn't align superscripts and subscripts:
T_c^{/Symbol \245}

But, that leaves an ugly space between the symbol and superscript. You can force alignment with an @ character:

T@_c^{/Symbol \245}
 This works fine for standard characters, but for slanted variables, the align character makes the superscript overlap. To fix this we insert a partial before the infty symbol in the superscript. To do this we combine two text effects, blank characters &{a} and font size scaling {/* }:

T@_c^{{/*0.5 &{c}}{/Symbol \245}}

To give the desired result. You can change the factor 0.5 to whatever you need, with 1.0 being full character width.

Thursday, 26 March 2009

Gnuplot PDF+Latex files

To create a pdf file from gnuplot with latex text do the following:

In the plot use the terminal:
set terminal epslatex


Then convert the eps to a pdf file.

Include the figure using
\input{figure.tex}

Wednesday, 25 March 2009

Printing variables from gnuplot to a file

To output variables such as fitting parameters from gnuplot use.
set fit errorvariables # creates a_err type variables for fitting errors
set print "tmp.dat"
print a,a_err,b,b_err