NCL Website header
NCL Home> Application examples> gsn_csm graphical interfaces || Data files for some examples

Example pages containing: tips | resources | functions/procedures

Vectors (high-level graphical interfaces)

Vector Plot Templates

gsn_csm_vector

gsn_csm_vector_map

gsn_csm_vector_scalar_map

gsn_csm_vector_map_polar

gsn_csm_vector_scalar_map_polar

gsn_csm_pres_hgt_vector

Additional Examples:

vector_1.ncl: Creates a vector plot over SST contours. gsnScalarContour = True, means that a scalar contour plot will also be drawn. The default is False, which colors the vectors by the scalar map (see example 4).

vcRefMagnitudeF = 5.0, Defines the reference vector magnitude. Use this to adjust the size of the vectors.

vcRefLengthF = 0.045, Defines the length of the reference vector

gsn_csm_vector_scalar_map_ce is the plot interface that draws a vector plot over a scalar contour plot.

cnLinesOn = False, Turns of the contour lines.

cnLineLabelsOn = False, Turns off the contour line labels.

vcGlyphStyle = "CurlyVector", Turns on the curly vectors (available since NCL version 4.2.0.a019).

vector_2.ncl: Add an overlay of wind magnitude contours.
vector_3.ncl: Draw vectors on a global map with a time stamp at the bottom.

gsn_csm_vector_map_ce is the plot interface that draws vectors over a map.

vcMinDistanceF = 0.017, Thins the vectors
vcRefAnnoOrthogonalPosF = -1.0, Moves the reference vector up.

infoTimeStamp is a utility for creating a time stamp at the bottom of the figure. The arguments are the workstation, the size of the text, and the right string. The left string is automatically generated and includes the time and date of the plots creation.

vector_4.ncl: Color vectors by a scalar field.
vector_5.ncl: A vector pressure/height plot.

gsn_csm_pres_hgt_vector is the plot template that draws vectors over a pressure height plot. Note that vcMapDirection must be set to False in order for the vectors to be pointing in the right direction. In V6.2.0, this resource will be set to False by default for the gsn_csm_pres_hgt_vector function.

There is another example of this template: example 7 in the pressure/height vs latitude applications page.

vector_6.ncl: Draws vectors with with automatic default clipping, and then with clipping turned off.

To turn off vector clipping, set the resource vpClipOn to False. This resources was added in version a034.

vector_7.ncl: This example shows how to position the vector arrows differently using the resource vcPositionMode. The default is "ArrowCenter". You can also use "ArrowHead" or "ArrowTail".

Polymarkers are added to each plot using gsn_add_polymarker
so you can see locations of the vector coordinates.

overlay_11.ncl: This example shows how to overlay vectors on top of a filled contour plot, where the contours are masked by a geographical area and the vectors are not. The masking is accomplished by setting:

  mpres@mpDataBaseVersion   = "MediumRes"
  mpres@mpMaskAreaSpecifiers = (/"China:states","Taiwan"/)

The mask area specifier names are part of the predefined group names available in the "MediumRes" map database.

This script was written by Yang Zhao (CAMS) (Chinese Academy of Meteorological Sciences).