Appendix A: Functions and procedures used in GSUN examples

main appendix | appendix A | appendix B | appendix C | appendix D
This appendix documents the GSUN functions and procedures that are used for creating graphics in the "Learning NCL by example" chapter.

These functions and procedures are only intended to help you get started using NCL, and are not intended as a standard interface to NCL. To use the full power of NCL, we recommend that you read the "Going beyond the basics" chapter as a starting point.

The GSUN functions and procedures are divided into three types:

and are documented in the "Alphabetical list of GSUN functions and procedures" section below.

Some of the functions and procedures have special resources associated with them. These resources are specific to the GSUN functions and procedures and can be used in addition to the regular resources. They are documented in the "Special GSUN resources" section and are listed with each function/procedure they can be used with.

Plotting functions

These functions create and draw plots that require data (XY plots, contour plots, vector plots, and streamline plots). Some of these functions also overlay plots on a map (as indicated by the "_map" suffix).

Function name Description
gsn_contour Create and draw a contour plot and advance the frame.
gsn_contour_map Create and draw a contour plot over a map and advance the frame.
gsn_streamline Create and draw a streamline plot and advance the frame.
gsn_streamline_map Create and draw a streamline plot over a map and advance the frame.
gsn_vector Create and draw a vector plot and advance the frame.
gsn_vector_map Create and draw a vector plot over a map and advance the frame.
gsn_vector_scalar Create and draw a vector plot with the vectors colored by a scalar field and advance the frame.
gsn_vector_scalar_map Create and draw a vector plot over a map with the vectors colored by a scalar field and advance the frame.
gsn_xy Create and draw an XY plot and advance the frame.

Output primitive procedures

These procedures draw output primitives (text, polygons, polylines, and polymarkers). None of these procedures advance the frame like the previous plotting functions.

Procedure name Description
gsn_polygon Draw a polygon on an existing plot.
gsn_polygon_ndc Draw a polygon anywhere in the viewport.
gsn_polyline Draw a polyline on an existing plot.
gsn_polyline_ndc Draw a polyline anywhere in the viewport.
gsn_polymarker Draw polymarkers on an existing plot.
gsn_polymarker_ndc Draw polymarkers anywhere in the viewport.
gsn_text Draw a text string on an existing plot.
gsn_text_ndc Draw a text string anywhere in the viewport.

Miscellaneous functions and procedures

These functions and procedures perform miscellaneous tasks, like opening a workstation to write the graphical output, defining a color map, drawing multiple plots on a frame, or drawing a labelbar or a map on the viewport.

Function/procedure name Description
gsn_define_colormap Define a color map using float RGB values or an array of color names.
gsn_labelbar_ndc Draw a labelbar anywhere in the viewport.
gsn_map Create and draw a map.
gsn_open_wks Open a workstation on which to draw graphics (a workstation can be either an NCGM file, a PostScript file, or an X11 window).
gsn_panel Draw multiple plots on one frame.
gsn_retrieve_colormap Retrieve the current color map in use.


Alphabetical list of GSUN functions and procedures

Each function/procedure is listed below with a description, synopsis, special resources (if any), and examples.

gsn_contour: plotting function
description

Creates and draws a contour plot and advances the frame. wks is the workstation opened by a call to gsn_open_wks, data is the 2-dimensional array to contour, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If data@_FillValue is set to some value, then any value in the data array that is equal to this value will not be plotted.

This function returns a value of type graphic, which represents the contour plot created. The data object created is returned as an attribute of contour called "data". For resource file purposes, the contour plot created is given the name "name_contour", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

contour = gsn_contour(
     wks        : graphic,
     data[*][*] : numeric,
     resources  : logical)
special resources

gsnFrame
gsnDraw
gsnScale
gsnShape
gsnTickMarksOn
gsnXAxisIrregular2Linear
gsnXAxisIrregular2Log
gsnYAxisIrregular2Linear
gsnYAxisIrregular2Log
examples

For examples on how to use gsn_contour, see GSUN examples 2, 8, and 11.


gsn_contour_map: plotting function
description

Creates and draws a contour plot over a map and advances the frame. wks is the workstation opened by a call to gsn_open_wks, data is the 2-dimensional array to contour, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If data@_FillValue is set to some value, then any value in the data array that is equal to this value will not be plotted.

This function returns a value of type graphic, which, since this function does an overlay, represents the map plot created. The contour plot created is returned as an attribute of map called "contour", and the data object created is returned as an attribute called "data". For resource file purposes, the contour plot created is given the name "name_contour", the map plot created is given the name "name_map", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

map = gsn_contour_map(
     wks        : graphic,
     data[*][*] : numeric,
     resources  : logical)
special resources

gsnFrame
gsnDraw
gsnScale
examples

For examples on how to use gsn_contour_map, see GSUN examples 5 and 9.


gsn_define_colormap: miscellaneous procedure
description

Defines a color map for a particular workstation. wks is the workstation opened by a previous call to gsn_open_wks and cmap is either a 2-dimensional n x 3 float array where n represents the number of colors to set and the second dimension represents the RGB value of each color, or cmap is a string array where each element is a color name or an RGB value enclosed in double quotes. This procedure should be called before any graphics are drawn.

synopsis

gsn_define_colormap(
     wks   : graphic,
     cmap)
examples

For examples on how to use gsn_define_colormap, see GSUN examples 2, 3, 5, 6, 8, 9, 10, and 11.


gsn_labelbar_ndc: miscellaneous procedure
description

Draws a labelbar anywhere in the viewport. wks is the workstation returned from a previous call to gsn_open_wks, nbox is the number of labelbar boxes, labels is an array of strings containing the labels for each box, x and y are the coordinates of the upper left corner of the labelbar in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

synopsis

gsn_labelbar_ndc(
     wks       : graphic,
     nbox      : integer,
     labels[*] : string,
     x         : numeric,
     y         : numeric,
     resources : logical)
examples

Try running the "gsn_labelbar_ndc.ncl" example to see how gsn_labelbar_ndc works. Be sure to download "gsn_code.ncl" before running this example.


gsn_map: miscellaneous function
description

Creates and draws a map and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, projection is one of the ten available map projections, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

This function returns a value of type graphic, which represents the map plot created. For resource file purposes, the map plot created is given the name "name_map", where name is the name of the workstation opened.

synopsis

map = gsn_map(
     wks        : graphic,
     projection : string,
     resources  : logical)
special resources

gsnFrame
gsnDraw
examples

Try running the "gsn_map.ncl" example to see how gsn_map works. Be sure to download "gsn_code.ncl" before running this example.


gsn_open_wks: miscellaneous function
description

Opens a workstation (for graphics to be drawn to) given the string type which can be "x11" (an X11 window), "ncgm" (an NCAR Graphics metafile), or "ps" (a PostScript file). If name is an empty string, then name will be set to "gsnapp". If type is "ncgm" or "ps", then the output file will be named "name.ncgm" or "name.ps" respectively. If a resource file called "name.res" exists, then it will be loaded by NCL. Note: name can have a directory path as part of its string, if the resource file you want to load is in a separate directory from where the NCL script resides.

The PostScript or NCGM file name can also be set as an attribute of type (wkMetaName for an NCGM file and wkPSFileName for a PostScript file). For example, if you want to set the NCGM file name to something other than name.ncgm, then set type equal to "ncgm", and set type@wkMetaName to the desired NCGM file name.

This function returns a value of type graphic, which represents the workstation created. The name of the workstation is returned as an attribute called "name". For resource file purposes, the application is given the name name, and the workstation is given the name "name_type".

synopsis

wks = gsn_open_wks(
     type : string,
     name : string)
examples

For examples on how to use gsn_open_wks, see any of the GSUN examples. For a much simpler example, run the "gsn_open_wks.ncl" example to see how it works. Trying changing "x11" to "ncgm" or "ps" to create an NCGM file or a PostScript file. Be sure to download "gsn_code.ncl" before running this example.


gsn_panel: miscellaneous procedure
description

Draws multiple plots on one frame and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, plots is the list of plots to draw, dims is the number of rows and columns you want the plots to be drawn in, and resources can optionally contain a special list of attributes that are resource names and their values. Note: gsn_panel assumes that all of the original plots are the same size.

synopsis

gsn_panel(
     wks       : graphic,
     plots[*]  : graphic,
     dims[2]   : integer,
     resources : logical)
special resources

gsnFrame
gsnPanelBottom
gsnPanelLeft
gsnPanelRight
gsnPanelTop
gsnPanelXWhiteSpacePercent
gsnPanelYWhiteSpacePercent
examples

For a simple example, try running "gsn_panel.ncl". Be sure to download "gsn_code.ncl" before running this example. For a more complex example that leaves room at the top and the bottom of the viewport for a title and a labelbar, see the script "panel.ncl."


gsn_polygon: output primitive procedure
description

Draws a filled polygon on the requested plot. wks is the workstation returned from a previous call to gsn_open_wks, plot is the value returned from a previous call to one of the GSUN plotting functions, x and y are 1-dimensional arrays defining the coordinates of the polygon, and resources can optionally contain an unlimited number of attributes that are resource names and their values. Note that x and y must be in the same data space as the data in plot.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polygon.

synopsis

gsn_polygon(
     wks       : graphic,
     plot      : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

Try running the "gsn_polygon.ncl" example to see how gsn_polygon works. Be sure to download "gsn_code.ncl" before running this example.


gsn_polygon_ndc: output primitive procedure
description

Draws a filled polygon on the viewport of the requested workstation. wks is the workstation returned from a previous call to gsn_open_wks, x and y are 1-dimensional arrays defining the coordinates of the polygon in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polygon.

synopsis

gsn_polygon_ndc(
     wks       : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

Try running the "gsn_polygon_ndc.ncl" example to see how gsn_polygon_ndc works. Be sure to download "gsn_code.ncl" before running this example. Note that this example is similar to the one for gsn_polygon, only this time the polygon is drawn in NDC space and not on an existing plot.


gsn_polyline: output primitive procedure
description

Draws a polyline on the requested plot. wks is the workstation returned from a previous call to gsn_open_wks, plot is the value returned from a previous call to one of the GSUN plotting functions, x and y are 1-dimensional arrays defining the coordinates of the line, and resources can optionally contain an unlimited number of attributes that are resource names and their values. Note that x and y must be in the same data space as the data in plot.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polyline.

synopsis

gsn_polyline(
     wks       : graphic,
     plot      : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

For an example on how to use gsn_polyline, see GSUN example 7.


gsn_polyline_ndc: output primitive procedure
description

Draws a polyline on the viewport of the requested workstation. wks is the workstation returned from a previous call to gsn_open_wks, x and y are 1-dimensional arrays defining the coordinates of the line in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polyline.

synopsis

gsn_polyline_ndc(
     wks       : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

For an example on how to use gsn_polyline_ndc, see GSUN example 7.


gsn_polymarker: output primitive procedure
description

Draws polymarkers on the requested plot. wks is the workstation returned from a previous call to gsn_open_wks, plot is the value returned from a previous call to one of the GSUN plotting functions, x and y are 1-dimensional arrays defining the coordinates of the markers, and resources can optionally contain an unlimited number of attributes that are resource names and their values. Note that x and y must be in the same data space as the data in plot.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polymarkers.

synopsis

gsn_polymarker(
     wks       : graphic,
     plot      : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

Try running the "gsn_polymarker.ncl" example to see how gsn_polymarker works. Be sure to download "gsn_code.ncl" before running this example.


gsn_polymarker_ndc: output primitive procedure
description

Draws polymarkers on the viewport of the requested workstation. wks is the workstation returned from a previous call to gsn_open_wks, x and y are 1-dimensional arrays defining the coordinates of the markers in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be part of the polymarkers.

synopsis

gsn_polymarker_ndc(
     wks       : graphic,
     x[*]      : numeric,
     y[*]      : numeric,
     resources : logical)
examples

Try running the "gsn_polymarker_ndc.ncl" example to see how gsn_polymarker_ndc works. Be sure to download "gsn_code.ncl" before running this example. Note that this example is similar to the one for gsn_polymarker, only this time the polymarkers are drawn in NDC space and not on an existing plot.


gsn_retrieve_colormap: miscellaneous function
description

Retrieves the current color map in use. wks is the workstation opened by a previous call to gsn_open_wks.

This function returns a 2-dimensional array dimensioned n x 3 of type float, where n is the number of colors in the color map.

synopsis

cmap = gsn_retrieve_colormap(
     wks        : graphic)
examples

For an example, try running the "gsn_retrieve_colormap.ncl" script. cmap will be a 32 x 3 float array.


gsn_streamline: plotting function
description

Creates and draws a streamline plot and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If one or both of u@_FillValue or v@_FillValue are set to some value, then any value in the u or v array that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which represents the streamline plot created. The data object created is returned as an attribute of streamline called "data". For resource file purposes, the streamline plot created is given the name "name_stream", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

streamline = gsn_streamline(
     wks       : graphic,
     u[*][*]   : numeric,
     v[*][*]   : numeric,
     resources : logical)
special resources

gsnFrame
gsnDraw
gsnScale
gsnShape
gsnTickMarksOn
gsnXAxisIrregular2Linear
gsnXAxisIrregular2Log
gsnYAxisIrregular2Linear
gsnYAxisIrregular2Log
examples

For an example on how to use gsn_streamline, see GSUN example 4.


gsn_streamline_map: plotting function
description

Creates and draws a streamline plot over a map and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If one or both of u@_FillValue or v@_FillValue are set to some value, then any value in the u or v array that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which, since this function does an overlay, represents the map plot created. The streamline plot created is returned as an attribute of map called "streamline", and the data object created is returned as an attribute called "data". For resource file purposes, the streamline plot created is given the name "name_stream", the map plot created is given the name "name_map", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

map = gsn_streamline_map(
     wks       : graphic,
     u[*][*]   : numeric,
     v[*][*]   : numeric,
     resources : logical)
special resources

gsnFrame
gsnDraw
gsnScale
examples

There is currently no example showing how to use gsn_streamline_map. However, gsn_streamline and gsn_vector_map are similar and you can see examples of them in GSUN examples 4 and 6.


gsn_text: output primitive procedure
description

Creates and draws a text string on the requested plot. wks is the workstation returned from a previous call to gsn_open_wks, plot is the value returned from a previous call to one of the GSUN plotting functions, x and y are 1-dimensional arrays defining the coordinates of the text string, and resources can optionally contain an unlimited number of attributes that are resource names and their values. Note that x and y must be in the same data space as the data in plot.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

For resource file purposes, the text object created is given the name "name_text", where name is the name of the workstation opened.

synopsis

gsn_text(
     wks       : graphic,
     plot      : graphic,
     text      : string,
     x         : numeric,
     y         : numeric,
     resources : logical)
examples

For examples on how to use gsn_text, see GSUN examples 7 and 10.


gsn_text_ndc: output primitive procedure
description

Creates and draws a text string on the viewport of the requested workstation. wks is the workstation returned from a previous call to gsn_open_wks, x and y are 1-dimensional arrays defining the coordinates of the text string in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call frame yourself if you want to advance the frame.

For resource file purposes, the text object created is given the name "name_text_ndc", where name is the name of the workstation opened.

synopsis

gsn_text_ndc(
     wks       : graphic,
     text      : string,
     x         : numeric,
     y         : numeric,
     resources : logical)
examples

For examples on how to use gsn_text_ndc, see GSUN examples 5, 7, and 11.


gsn_vector: plotting function
description

Creates and draws a vector plot and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If one or both of u@_FillValue or v@_FillValue are set to some value, then any value in the u or v array that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which represents the vector plot created. The data object created is returned as an attribute of vector called "data". For resource file purposes, the vector plot created is given the name "name_vector", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

vector = gsn_vector(
     wks       : graphic,
     u[*][*]   : numeric,
     v[*][*]   : numeric,
     resources : logical)
special resources

gsnFrame
gsnDraw
gsnScale
gsnShape
gsnTickMarksOn
gsnXAxisIrregular2Linear
gsnXAxisIrregular2Log
gsnYAxisIrregular2Linear
gsnYAxisIrregular2Log
examples

For an example on how to use gsn_vector, see GSUN example 3.


gsn_vector_map: plotting function
description

Creates and draws a vector plot over a map and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If one or both of u@_FillValue or v@_FillValue are set to some value, then any value in the u or v array that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which, since this function does an overlay, represents the map plot created. The vector plot created is returned as an attribute of map called "vector", and the data object created is returned as an attribute called "data". For resource file purposes, the vector plot created is given the name "name_vector", the map plot created is given the name "name_map", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

map = gsn_vector_map(
     wks       : graphic,
     u[*][*]   : numeric,
     v[*][*]   : numeric,
     resources : logical)
special resources

gsnFrame
gsnDraw
gsnScale

examples

For an example on how to use gsn_vector_map, see GSUN example 6.


gsn_vector_scalar: plotting function
description

Creates and draws a vector plot, colors the vectors according to a scalar field, and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, scalar_data is the 2-dimensional scalar field, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If any of u@_FillValue, v@_FillValue, or scalar_data@_FillValue are set to some value, then any value in these arrays that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which represents the vector plot created. The vector field data object created is returned as an attribute of vector called "vfdata", and the scalar field data object created is returned as an attribute called "sfdata". For resource file purposes, the vector plot created is given the name "name_vector", the vector field data object created is given the name "name_vfdata", and the scalar field data object created is given the name "name_sfdata", where name is the name of the workstation opened.

synopsis

vector = gsn_vector(
     wks               : graphic,
     u[*][*]           : numeric,
     v[*][*]           : numeric,
     scalar_data[*][*] : numeric,
     resources         : logical)
special resources

gsnFrame
gsnDraw
gsnScale
gsnShape
gsnTickMarksOn
gsnXAxisIrregular2Linear
gsnXAxisIrregular2Log
gsnYAxisIrregular2Linear
gsnYAxisIrregular2Log
examples

For an example on how to use gsn_vector_scalar, see GSUN example 3.


gsn_vector_scalar_map: plotting function
description

Creates and draws a vector plot over a map with the vectors colored according to a scalar field, and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, u and v are the 2-dimensional vector arrays, scalar_data is the 2-dimensional scalar field, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

If any of u@_FillValue, v@_FillValue, or scalar_data@_FillValue are set to some value, then any value in these arrays that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which, since this function does an overlay, represents the map plot created. The vector plot created is returned as an attribute of map called "vector", and the vector and scalar field data objects created are returned as attributes called "vfdata" and "sfdata" respectively. For resource file purposes, the vector plot created is given the name "name_vector", the vector field data object created is given the name "name_vfdata", the scalar field data object created is given the name "name_sfdata", and the map plot created is given the name "name_map", where name is the name of the workstation opened.

synopsis

map = gsn_vector_scalar_map(
     wks               : graphic,
     u[*][*]           : numeric,
     v[*][*]           : numeric,
     scalar_data[*][*] : numeric,
     resources         : logical)
special resources

gsnFrame
gsnDraw
gsnScale
examples

For an example on how to use gsn_vector_scalar_map, see GSUN example 6.


gsn_xy: plotting function
description

Creates and draws an xy plot with single or multiple lines and advances the frame. wks is the workstation returned from a previous call to gsn_open_wks, x and y are either 1 or 2-dimensional arrays, and resources can optionally contain an unlimited number of attributes that are resource names and their values. If x or y is a 2-dimensional array, then the first dimension defines the number of lines, and the second dimension defines the number of points (which must be the same for both arrays).

If one or both of x@_FillValue or y@_FillValue are set to some value, then any value in the x or y array that is equal to its corresponding _FillValue will not be plotted.

This function returns a value of type graphic, which represents the XY plot created. The data object created is returned as an attribute of xy called "data". For resource file purposes, the XY plot created is given the name "name_xy", and the data object created is given the name "name_data", where name is the name of the workstation opened.

synopsis

xy = gsn_xy(
     wks       : graphic,
     x         : numeric,
     y         : numeric,
     resources : logical)
special resources

gsnFrame
gsnDraw
gsnScale
gsnShape
gsnTickMarksOn
examples

For examples on how to use gsn_xy, see GSUN examples 1, 7, 10, and 11.


Special GSUN resources

Some of the GSUN functions and procedures have special resources associated with them. These resources all start with the letters "gsn" and are listed above with the functions and procedures they are used with.

The table below lists all of these special resources and what they do:

GSUN resource name Description
gsnDraw

Default: True

If set to False, then the plot in question will not be drawn when the plotting function is called.

gsnFrame

Default: True

If set to False, then the frame will not be advanced when the plotting function is called.

gsnPanelBottom

Default: 0.0

By default, the gsn_panel routine tries to place all of the plots in the largest area possible in the viewport. This resource, which must be a value greater than or equal to 0.0 and less than 1.0, allows you to set a limit for where the bottommost plot(s) can be draw. This allows you to reserve white space at the bottom for something like a labelbar.

gsnPanelLeft

Default: 0.0

By default, the gsn_panel routine tries to place all of the plots in the largest area possible in the viewport. This resource, which must be a value greater than or equal to 0.0 and less than 1.0, allows you to set a limit for where the leftmost plot(s) can be draw. This allows you to reserve white space at the left for something like a labelbar.

gsnPanelRight

Default: 1.0

By default, the gsn_panel routine tries to place all of the plots in the largest area possible in the viewport. This resource, which must be a value greater than 0.0 and less than or equal to 1.0, allows you to set a limit for where the rightmost plot(s) can be draw. This allows you to reserve white space at the right for something like a labelbar.

gsnPanelTop

Default: 1.0

By default, the gsn_panel routine tries to place all of the plots in the largest area possible in the viewport. This resource, which must be a value greater than 0.0 and less than or equal to 1.0, allows you to set a limit for where the topmost plot(s) can be draw. This allows you to reserve white space at the top for something like a title.

gsnPanelXWhiteSpacePercent

Default: 1.0

Takes a percentage value from 0 to 100 to indicate what percentage of the total plot width should be used for white space at the left and right of each plot in a call to gsn_panel.

gsnPanelYWhiteSpacePercent

Default: 1.0

Takes a percentage value from 0 to 100 to indicate what percentage of the total plot height should be used for white space at the top and bottom of each plot in a call to gsn_panel.

gsnScale

Default: False

If set to True, then the X and Y axis labels will be scaled to be the same size and the tick marks will be scaled to be the same length. This is useful when the X and Y axis are of different lengths, but you still want the labels and tick marks to be the same for each axis.

gsnShape

Default: False

If set to True, then whichever axis has the smaller range will be resized so that the ratio of the axes ranges is the same as the ratio of the axes lengths. For example, if the Y axis ranges from 1 to 50, and the X axis ranges from 1 to 100, then setting gsnShape to True will cause the Y axis to be resized to half the length of the X axis. If this resource is set to True, then gsnScale is also automatically set to True.

gsnTickMarksOn

Default: True

If set to False, then no tickmarks or tickmark labels will be drawn in the plotting functions where tickmarks are drawn automatically.

gsnXAxisIrregular2Linear

Default: False

If set to True, then the X axis will be linearized. This resource should only be set to True if either sfXArray or vfXArray is set (depending on whether you are creating a contour, vector, or streamline plot) and their values are not already linear.

gsnXAxisIrregular2Log

Default: False

If set to True, then the X axis will be changed to log scaling. This resource should only be set to True if either sfXArray or vfXArray is set (depending on whether you are creating a contour, vector, or streamline plot). Otherwise, you can just use the trXLog resource to indicate you want log scaling.

gsnYAxisIrregular2Linear

Default: False

If set to True, then the Y axis will be linearized. This resource should only be set to True if either sfYArray or vfYArray is set (depending on whether you are creating a contour, vector, or streamline plot) and their values are not already linear.

gsnYAxisIrregular2Log

Default: False

If set to True, then the Y axis will be changed to log scaling. This resource should only be set to True if either sfYArray or vfYArray is set (depending on whether you are creating a contour, vector, or streamline plot). Otherwise, you can just use the trYLog resource to indicate you want log scaling.


home | toc | about doc | intro | examples | basics | beyond basics | hints and tips | appendix | glossary