Digital Library of Mathematical Functions
The Gamma Function -- Graphics

### Graphics

###### Contents

- Real Argument
- The Psi Function
- Complex Argument

#### Real Argument

This graph shows the Γ ( x ) and 1 Γ ( x ) . To create these two graphs in Axiom:

     -- Draw the first graph in a viewport
     viewport1:=draw(Gamma(i), i=-4.2..4, adaptive==true, unit==[1.0,1.0])
     -- Draw the second graph in a viewport
     viewport2:=draw(1/Gamma(i), i=-4.2..4, adaptive==true, unit==[1.0,1.0])
     -- Get the Gamma graph from the first viewport and layer it on top
     putGraph(viewport2,getGraph(viewport1,1),2)
     -- Remove the points and leave the lines
     points(viewport2,1,"off")
     points(viewport2,2,"off")
     -- Show the combined graph
     makeViewport2D(viewport2)

ln Γ ( x ) . This function is convex on ( 0 , ∞ ) ;
compare Functional Relations

You can construct this graph with the Axiom commands:

      -- draw the graph of log(Gamma) in a viewport
      viewport1:=draw(log Gamma(i), i=0..8, adaptive==true, unit==[1.0,1.0])
      -- turn off the points and leave the lines
      points(viewport1,1,"off")

#### The Psi Function ψ ( x )

This function is a special case of the polygamma function. In particular, ψ ( x ) is equal to polygamma(0,x).

You can reconstruct this graph in Axiom by:

      -- first construct the psi function
      psi(x)==polygamma(0,x)
      -- draw the graph in a viewport
      viewport:=draw(psi(y),y=-3.5..4,adaptive==true)
      -- make the gradient obvious
      scale(viewport,1,0.9,22.5)
      -- and recenter the graph
      translate(viewport,1,0,-0.02)
      -- turn off the points and keep the line
      points(viewport,1,"off")

#### Complex Argument

Γ ( x + ⅈ y ) .
You can reconstruct this image in Axiom with:

      -- Set up the default viewpoint
      viewPhiDefault(-%pi/4)
      -- define the point set function
      gam(x,y)==
        g:=Gamma complex(x,y)
        point [x,y,max(min(real g,4),-4), argument g]
      -- draw the image and remember the viewport
      viewport:=draw(gam, -4..4,-3..3,var1Steps==100,var2Steps==100)
      -- set the color mapping for the image
      colorDef(viewport,blue(),blue())
      -- and smoothly shade it
      drawStyle(viewport,"smooth")

1 Γ ( x + ⅈ y )

You can reproduce this image from Axiom with:

      -- Set up the default viewpoint
      viewPhiDefault(-%pi/4)
      -- Define the complex Gamma inverse function
      gaminv(x,y)==
        g:=1/(Gamma complex(x,y))
        point [x,y,max(min(real g,4),-4), argument g]
      -- draw the 3D image and remember the viewport
      viewport:=draw(gaminv, -4..4,-3..3,var1Steps==100,var2Steps==100)
      -- make the image a uniform color
      colorDef(viewport,blue(),blue())
      -- and make it pretty
      drawStyle(viewport,"smooth")

To get these exact images with the colored background you need to use GIMP to set the background. The steps I used are:

1. Save the image as a pixmap
2. Open the saved file in gimp
3. Dialogs->Colors->ColorPicker button
4. Eyedrop the color of the web page
5. Set the color as the foreground on the FG/BG page
6. Dialogs->Layers
7. Duplicate Layer
8. Layer->Stack->Select bottom layer
9. Edit->Fill with Foreground color
10. (on Layers panel)Select image
11. (on Layers panel) Mode->Darken Only

Note that you may have to use "lighten only" first before it will allow you to choose "darken only".