NCL Website header
NCL Home > Documentation > HLUs > API


The Fortran name of this function is NhlFNDCPolyline.

Given arrays containing the X and Y coordinates of points in NDC space, this function outputs an immediate-mode polyline connecting each of the points.

C Synopsis

#include <ncarg/hlu/hlu.h>
#include <hfile for Transform class object>

NhlErrorTypes NhlNDCPolyline(
		int	pid,
		int     gsid,
		float 	*x,
		float	*y,
		int	n,

Fortran Synopsis

      subroutine NhlFNDCPolyline(pid, gsid, x, y, n, ierr)
      integer pid, gsid, n, ierr
      float x(n), y(n)


pid (input)
Id of a Transform or Workstation object.
gsid (input)
Id of a GraphicStyle object.
x (input)
Array of X-Axis coordinate values in NDC space.
y (input)
Array of Y-Axis coordinate values in NDC space.
n (input)
Number of elements in the coordinate arrays x and y.
ierr (output, Fortran only)
Error code.


Type name:		NhlTErrorTypes
typedef enum _NhlErrType{
	NhlFATAL	= -4,	/* "FATAL"	*/
	NhlWARNING	= -3,	/* "WARNING"	*/
	NhlINFO		= -2,	/* "INFO"	*/
	NhlNOERROR	= -1	/* "NOERROR"	*/
} NhlErrorTypes;


This function draws an immediate-mode polyline in NDC space. If the parameter pid specifies a transform (a plot object) the polyline is clipped to the object's viewport. If the parameter pid specifies a workstation, the polyline is clipped only at the boundaries of the NDC viewspace. An immediate-mode polyline appears as soon as the low-level point buffer is flushed after the function is called. It is not drawn when the object's Draw method is invoked.

You specify the polyline's attributes by passing in a GraphicStyle object using the parameter gsid. If gsid is set to NhlNULLOBJID (0) then the line attributes are determined by the current settings of the Workstation default GraphicStyle object. Retrieve the id of the default GraphicStyle object using the read-only Workstation resource wkDefGraphicStyleId.

Return Values

The NhlNDCPolyline C function returns a value of type NhlErrorTypes, and the NhlFNDCPolyline Fortran subroutine returns the error in ierr. The following table indicates what the various return Error Values mean:
Value	|			Meaning
NOERROR	|	function successful
INFO	|	minor recoverable error
WARNING	|	recoverable error
FATAL	|	function failed; continuing the program
	|       may result in core dump

See Also