%
% Achtung: Aktuelle TeX-Version notwendig.
%
% Aufruf unter Unix): pdflatex -shell-escape gnuplot.tex
%
\documentclass[a4paper]{article}
\usepackage{gnuplottex}
 
\begin{document}

\begin{figure}[htbp] 
  \begin{gnuplot} 
    set terminal epslatex color
    plot x**2
  \end{gnuplot}
  \caption{test}
\end{figure}
 

\begin{gnuplot}
set terminal epslatex color
set samples 20
set isosamples 21
set xlabel 'X axis'
set ylabel 'Y axis'
set zlabel 'Z axis' offset 1, 0
set view 60, 30, 0.85, 1.1
set title '3D gnuplot demo - contour plot'
set contour
splot x*y
\end{gnuplot}


	

\begin{gnuplot}
set terminal epslatex color
#
# Another example of pm3d hidden surface removal,
# this time using pm3d depth-ordering
#
set multiplot title "Interlocking Tori"
set title "PM3D surface\nno depth sorting"

set parametric
set urange [-pi:pi]
set vrange [-pi:pi]
set isosamples 50,20

set origin -0.02,0.0
set size 0.55, 0.9

unset key
unset xtics
unset ytics
unset ztics
set border 0
set view 60, 30, 1.5, 0.9
unset colorbox

set pm3d scansbackward
splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v) with pm3d, \
      1+cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v) with pm3d

set title "PM3D surface\ndepth sorting"

set origin 0.40,0.0
set size 0.55, 0.9
set colorbox vertical user origin 0.9, 0.15 size 0.02, 0.50
set format cb "%.1f"

set pm3d depthorder
splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v) with pm3d, \
      1+cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v) with pm3d

unset multiplot
\end{gnuplot}

\begin{gnuplot}
set terminal epslatex color
set dummy u,v
set key bmargin center horizontal Right noreverse enhanced autotitles nobox
set parametric
set view 45, 50, 1, 1
set isosamples 50, 10
set hidden3d back offset 1 trianglepattern 3 undefined 1 altdiagonal bentover
set ztics -1.00000,0.25,1.00000 norangelimit
set title "Parametric Sphere" 
set urange [ -1.57080 : 1.57080 ] noreverse nowriteback
set vrange [ 0.00000 : 6.28319 ] noreverse nowriteback
splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
\end{gnuplot}

\end{document}
