arrow plot of wind data

Hello, I have wind direction (in degree) and wind speed data in a time sequence (every min). I want to plot x-axis as date-time, and a 2-D arrow representing wind direction (angle) and wind speed (length) at each time. How do I make it?

Thank you.
Wind barb plots are not well explained in the Igor documentation. Here is an explanation of how to do it.

You need to create an XY plot in markers mode.

Then you turn on barb mode (really arrow mode) using "ModifyGraph arrowMarker", passing to it a wave that specifies the length, angle and number of barbs for each point.

If you want to color-code the wind barbs, you turn color as f(z) mode using "ModifyGraph zColor", passing to it a wave that specifies the color for each point.

Here is an example:
// Make XY data
Make/O xData = {1, 2, 3}, yData = {1, 2, 3}
Display yData vs xData                // Make graph
ModifyGraph mode(yData) = 3        // Marker mode

// Make a barb data wave to control the length, angle and number of barbs for each point.
// To control the number of barbs, column 2 must have a column label of WindBarb
Make/O/N=(3,3) barbData    // Controls barb length, angle and number of barbs
SetDimLabel 1, 2, WindBarb, barbData    // Set column label to WindBarb
Edit /W=(439,47,820,240) barbData

// Put some data in barbData
barbData[0][0]= {20,25,30}    // Column 0: Barb lengths in points
barbData[0][1]= {0.523599,0.785398,1.0472}        // Column 1: Barb angle in radians
barbData[0][2]= {10,20,30}    // Column 2: Wind speed from 0 (no barbs) to 40 (4 barbs)

// Set trace to arrow mode to turn barbs on
ModifyGraph arrowMarker(yData) = {barbData, 1, 10, 1, 1}

// Make an RGB color wave
Make/O/N=(3,3) barbColor
Edit /W=(440,272,820,439) barbColor

// Store some colors in the color wave
barbColor[0][0]= {65535,0,0}        // Red
barbColor[0][1]= {0,65535,0}        // Green
barbColor[0][2]= {0,0,65535}        // Blue

// Turn on color as f(z) mode
ModifyGraph zColor(yData)={barbColor,*,*,directRGB,0}



Execute the commands one-by-one to get an understanding of how it works.

You can eliminate the barbColor wave by using a color table lookup instead of a color wave. The various color as f(z) modes are explained under
"Setting Trace Properties from an Auxiliary (Z) Wave":
DisplayHelpTopic "Setting Trace Properties from an Auxiliary (Z) Wave"


You will need a solid understanding of Igor. If you have not already done it or you have forgotten, do the first half of the Igor Getting started documentation (Help->Getting Started).
Thanks. I think I may not be very clear on what I need. The script you list is too complicated in my application. I only want to make a simple vector plot as shown in the attachment.




























hrodstein wrote:
Wind barb plots are not well explained in the Igor documentation. Here is an explanation of how to do it.

You need to create an XY plot in markers mode.

Then you turn on barb mode (really arrow mode) using "ModifyGraph arrowMarker", passing to it a wave that specifies the length, angle and number of barbs for each point.

If you want to color-code the wind barbs, you turn color as f(z) mode using "ModifyGraph zColor", passing to it a wave that specifies the color for each point.

Here is an example:
// Make XY data
Make/O xData = {1, 2, 3}, yData = {1, 2, 3}
Display yData vs xData                // Make graph
ModifyGraph mode(yData) = 3        // Marker mode

// Make a barb data wave to control the length, angle and number of barbs for each point.
// To control the number of barbs, column 2 must have a column label of WindBarb
Make/O/N=(3,3) barbData    // Controls barb length, angle and number of barbs
SetDimLabel 1, 2, WindBarb, barbData    // Set column label to WindBarb
Edit /W=(439,47,820,240) barbData

// Put some data in barbData
barbData[0][0]= {20,25,30}    // Column 0: Barb lengths in points
barbData[0][1]= {0.523599,0.785398,1.0472}        // Column 1: Barb angle in radians
barbData[0][2]= {10,20,30}    // Column 2: Wind speed from 0 (no barbs) to 40 (4 barbs)

// Set trace to arrow mode to turn barbs on
ModifyGraph arrowMarker(yData) = {barbData, 1, 10, 1, 1}

// Make an RGB color wave
Make/O/N=(3,3) barbColor
Edit /W=(440,272,820,439) barbColor

// Store some colors in the color wave
barbColor[0][0]= {65535,0,0}        // Red
barbColor[0][1]= {0,65535,0}        // Green
barbColor[0][2]= {0,0,65535}        // Blue

// Turn on color as f(z) mode
ModifyGraph zColor(yData)={barbColor,*,*,directRGB,0}



Execute the commands one-by-one to get an understanding of how it works.

You can eliminate the barbColor wave by using a color table lookup instead of a color wave. The various color as f(z) modes are explained under
"Setting Trace Properties from an Auxiliary (Z) Wave":
DisplayHelpTopic "Setting Trace Properties from an Auxiliary (Z) Wave"


You will need a solid understanding of Igor. If you have not already done it or you have forgotten, do the first half of the Igor Getting started documentation (Help->Getting Started).

wind plot.jpg
Quote:
The script you list is too complicated in my application. I only want to make a simple vector plot as shown in the attachment.


Here is a simplified version that just creates lines with arrowheads:
// Make XY data
Make/O xData = {1, 2, 3}, yData = {1, 2, 3}
Display yData vs xData                // Make graph
ModifyGraph mode(yData) = 3        // Marker mode
 
// Make a barb data wave to control the length, angle and number of barbs for each point.
// To control the number of barbs, column 2 must have a column label of WindBarb
Make/O/N=(3,2) arrowData    // Controls line length and angle
Edit /W=(439,47,820,240) arrowData
 
// Put some data in arrowData
arrowData[0][0]= {20,25,30}    // Column 0: Line lengths in points
arrowData[0][1]= {0.523599,0.785398,1.0472}        // Column 1: Line angle in radians
 
// Set trace to arrow mode
ModifyGraph arrowMarker(yData) = {arrowData, 1, 4, 2, 1}


For details read about the arrowMarker keyword of the ModifyGraph operation.

Also choose File->Example Experiments->Feature Demos2->Barbs and Arrows.

And File->Example Experiments->Graphing Techniques->Arrow Plot.

Hello,

I have netcdf files from the ECMWF. There are data for u and v wind component, so I can create 2 new waves for wind direction and wind speed easily.

I would like to plot a wind barb plot. I can't understand the afore-mentioned code at some points. Could someone explain in detail? For example xdata and ydata are Latitude and Longitude of an area?

After applying all this code, no barbs have been appeared on my graph. I have just markers.
Hello again,

spefying what I need, as a continue of the previous message.

I have two 2D matrices, let's say wind_dir for wind direction and wind_spd for wind speed at 10 m over Europe.

Questions:

1. Instead of ydata and xdata, should I use latitude and longitude?

2. If I need to create a matrix with 3 columns for size, wind_dir and wind_spd, how could I use my wind_dir data, which is 2d, in just one column?

Could anyone help please?