File: lnGamma.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (52 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# We don't have a built-in complex Gamma function 
# but it can be approximated using exp(lnGamma(z))
#
# Note:
#  - handling of large approximate values near poles could be better
#  - would it be possible to clip +Inf against zmax?
#  - functions are not consistent in returning +Inf or VERYLARGE or NaN
#

# Check support for lnGamma
if (!strstrt(GPVAL_COMPILE_OPTIONS, "+COMPLEX_FUNC")) {
    print "This copy of gnuplot does not support complex lnGamma"
    exit  # return to caller
}

save_encoding = GPVAL_ENCODING
set encoding utf8

unset cornerpoles
set grid x y z vertical lw 1
set border 31 + 768 + 96
set view 66, 304, 1.00286, 1.2
set samples 401
set isosamples 400

set xyplane at 0
set xrange [-3.5 : 3.5]
set yrange [-3.0 : 3.0]
set zrange [ 0.0 : 8.0]
set xlabel "{/Times:Italic=16 x}" offset -3,-1
set ylabel "{/Times:Italic=16 iy}" offset 5,-1
set xtics 1 offset 0,-0.5
set ytics 1 offset 0,-0.5

set pm3d lighting primary 0.5 specular 0.2 spec2 0.4
set palette cubehelix start 0 cycles 2.0 gamma 2.0
set palette negative
set cbrange [0.01:20.]
set log cb
unset colorbox

Gamma(z) = exp(lnGamma(z))
set title "{/Times:Italic=16 Γ(x+iy) }{/Times:Normal=18  = exp(lnGamma(x + y*I)}"
set title offset 0,0.5
unset key

splot abs(Gamma(x + y*I)) with pm3d title "{/Times:Italic=16 Γ(x+iy)}"

pause -1 "<cr> to continue"
reset
set encoding save_encoding