# PGPLOT Module: PGFUNX -- function defined by Y = F(X)

SUBROUTINE PGFUNX (FY, N, XMIN, XMAX, PGFLAG)

REAL FY

EXTERNAL FY

INTEGER N

REAL XMIN, XMAX

INTEGER PGFLAG

Draw a curve defined by the equation Y = FY(X), where FY is a

user-supplied subroutine.

**Arguments**

FY (external real function): supplied by the user, evaluates

Y value at a given X-coordinate.

N (input) : the number of points required to define the

curve. The function FY will be called N+1 times.

If PGFLAG=0 and N is greater than 1000, 1000

will be used instead. If N is less than 1,

nothing will be drawn.

XMIN (input) : the minimum value of X.

XMAX (input) : the maximum value of X.

PGFLAG (input) : if PGFLAG = 1, the curve is plotted in the

current window and viewport; if PGFLAG = 0,

PGENV is called automatically by PGFUNX to

start a new plot with X limits (XMIN, XMAX)

and automatic scaling in Y.

Note: The function FY must be declared EXTERNAL in the Fortran

program unit that calls PGFUNX. It has one argument, the

x-coordinate at which the y value is required, e.g.

REAL FUNCTION FY(X)

REAL X

FY = .....

END