Persönliche Werkzeuge
Ansichten
Navigation
Werkzeuge

Hilfe:Gnuplot

Aus StudiWiki

Wechseln zu: Navigation, Suche

Es ist möglich Graphen in das Wiki einzubetten ohne sie als Bild hochzuladen. Dabei wird das Programm Gnuplot 4.2 benutzt.

[bearbeiten] Benutzung

Um einen Graphen einzubinden müssen gültige Gnuplot Anweisungen in die Tags <gnuplot> ... </gnuplot> eingebettet werden. Bei ungültigen Anweisungen wird lediglich ein leeres Bild (mit defektem link) angezeigt. Gnuplot erfordert aufgrund seiner Funktionsvielfalt eine gewisse Einarbeitungszeit. Es existieren jedoch zahlreiche Einführungen im WWW die in den meisten Fällen schnell zum Ziel führen.

[bearbeiten] Beispiele

Gnuplot Plot

<gnuplot>
   set output 'quadFuncs.png'
   set size 0.4,0.4
   set xlabel "x"
   set ylabel "y"
   plot [x=-4:4] x**2-3, -x**2
</gnuplot>

Gnuplot Plot

<gnuplot>
 plot '-' using 1:2 t 'Quadratische Approximation' with linesp lt 1 lw 3, \
  '-' using 1:2 t 'Kubische Approximation' with linesp lt 2 lw 3
  1 2
  2 4
  3 8
  e
  1 3
  2 9
  3 27
  e
 </gnuplot>

Gnuplot Plot

<gnuplot>
 set size 1,1
 set key left box
 set samples 50
 plot [-10:10] sin(x),atan(x),cos(atan(x))
</gnuplot>

Gnuplot Plot

<gnuplot>
set key left box
set autoscale
set samples 800
plot [-30:20] sin(x*20)*atan(x)
</gnuplot>

Gnuplot Plot

<gnuplot>
 set title "Let's smile with parametric filled curves"
 set key off
 unset border
 unset xtics
 unset ytics
 set grid
 set arrow 1 from -0.1,0.26 to 0.18,-0.17 front size 0.1,40 lt 5 lw 4
 set label 1 "gnuplot" at 0,1.2 center front
 set label 2 "gnuplot" at 0.02,-0.6 center front
 set parametric
 set xrange [-1:1]
 set yrange [-1:1.6]
 plot [t=-pi:pi] \
	sin(t),cos(t) with filledcurve xy=0,0 lt 15,	\
	sin(t)/8-0.5,cos(t)/8+0.4 with filledcurve lt 3,	\
	sin(t)/8+0.5,cos(t)/8+0.4 with filledcurve lt 3,	\
	t/5,abs(t/5)-0.8 with filledcurve xy=0.1,-0.5 lt 1, \
	t/3,1.52-abs(t/pi) with filledcurve xy=0,1.8 lt -1
</gnuplot>

Gnuplot Plot

<gnuplot>
 unset arrow
 unset label
 set grid
 splot x**2+y**2, x**2-y**2
</gnuplot>

Gnuplot Plot

<gnuplot>
 set contour base
 set title "3D gnuplot demo - 2 surfaces"
 splot x**2*y**3, x**3*y**2
</gnuplot>



Gnuplot Plot

<gnuplot>
 set logscale z
 set hidden3d
 set isosamples 60
 set ticslevel 0.
 set view 20,340	#HBB: ,1,2
 set xlabel "x"
 set ylabel "y"
 splot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2
</gnuplot>


[bearbeiten] Links