[Tex/LaTex] converting tikz to pdf

graphicstikz-pgf

I would like to create a graphic with gnuplot for example and import it to latex to implement it in a text. The problem is that its caption, which I created with latex, has a different font, size etc. than the labeling of the axes which were created by gnuplot.

Now I thought I might create an image via gnuplot saved as tikz, so that, when I include it in latex, the labeling's font etc., changes to the standards of the rest of my document in latex. At the end I would like to see a PDF format file which contains my text and the graphic with the same font-/ size etc.

Best Answer

Example

Plotting the von Neumann entropy of a two-level spin system, which was prepared in a state of superposition.

Gnuplot code

#!/usr/bin/env gnuplot

reset
set terminal tikz standalone
set output "entropy.tex"

unset key
set grid
set xrange [0:1]
set samples 1000
set title 'Von Neumann entropy'
set xlabel '$\lambda$'
set ylabel '$S(\lambda)$'

plot -( 1./2. * (1 + sqrt(1-2*x+2*x**2)) *      log( 1./2. * (1 + sqrt(1-2*x+2*x**2)) )         +       1./2. * (1 - sqrt(1-2*x+2*x**2)) *      log( 1./2. * (1 - sqrt(1-2*x+2*x**2)) ) )

LaTeX Output

Compile the produced entropy.tex using pdflatex. You now get the correct LaTeX fonts.

enter image description here