
NCL > Application examples > Basic examples
VectorPlot example 4
How to rotate a VectorPlot 90 degrees while preserving the original relationship of the data elements
This VectorPlot example can be created using HLU function calls or NCL. It demonstrates how to rotate a VectorPlot 90 degrees while preserving the original relationship of the data elements. The names of the source files for this example are vc04c.c, vc04f.f, and vc04n.ncl.
Discussion
This module discusses how to create this plot using NCL or HLU C or FORTRAN calls. A resource file is included with this example, and it is called vc04.res. This file is used to change the default resource settings for the plot. Some of the VectorPlot line resources are tweaked in the resource file to show how to change the appearance of the vectors.A detailed discussion of how this example works appears in its source code.
Creating the plot using HLUs
The HLU C program that generates this plot is called vc04c.c.
Creating the plot using HLU FORTRAN library calls
The HLU FORTRAN program that generates this plot is called vc04f.f.
Creating the plot using NCL
The NCL script that generates this plot is called vc04n.ncl.
The data
The data for this plot are from an ASCII file called "uvdata0.asc".The data file is located in your NCAR Graphics data directory in a subdirectory called "asc". You can get the name of the data directory by typing "ncargpath data" at your shell prompt.
How to run this example
This example can be created using a C program (vc04c.c), a FORTRAN program (vc04f.f), or an NCL script (vc04n.ncl). The example is installed in the following locations:
- $NCARG_ROOT/lib/ncarg/hluex/vectorplot/vc04c.c
- $NCARG_ROOT/lib/ncarg/hluex/vectorplot/vc04f.f
- $NCARG_ROOT/lib/ncarg/nclex/vectorplot/vc04n.ncl
- $NCARG_ROOT/lib/ncarg/resfiles/vectorplot/vc04.res
- $NCARG_ROOT/lib/ncarg/data/asc/uvdata0.asc