\cancel mode verify ! poly_vectors: Sets up the drawing of a sequence of color-filled vectors ! scattered on plot with Cartesian coordinates ! Programmed by E. D. Cokelet, NOAA/PMEL, 11 Feb 2003 ! Last modified 6 Mar 2003 ! Usage: (for examples, run poly_vec_demo.jnl) ! go poly_vectors x_vect y_vect u_comp v_comp vector_scale "arrow" ! polygon/over/nolabel/key/pal=rainbow/line plt_x_arrow, plt_y_arrow, my_values[j=1:`num_vectors`] ! with inputs: ! x_vect = sequence of x coordinates of vector tails ! y_vect = sequence of y coordinates of vector tails ! u_comp = sequence of x-ward components of vectors ! v_comp = sequence of y-ward components of vectors ! vector_scale = vector length in user units (e.g. cm/s) corresponding to ! a half-inch-long vector ! "arrow" or "stick" = with or without arrow heads ! and with outputs: ! num_vectors = number of vector arrow polygons to plot ! plt_x_arrow = (7 x num_vectors) x-y array whose x-values are the ! x-components of the vector arrow polygons on the plot. ! The y-values are counters, one for each vector. ! plt_y_arrow = (7 x num_vectors) x-y array whose x-values are the ! y-components of the vector arrow polygons on the plot. ! and where: ! my_values = An input y array of num_vectors values corresponding to the ! color-fill levels of the vectors. ! Note 1: A plot in Cartesian coordinates must have been drawn using Ferret ! before calling vectors. ! Note 2: Any polygon command can be used to plot the vectors. define region/default save cancel region set data/save ! Place vector positions and components on a y axis let vect_tail_x1 = ysequence( $1 ) ! Sequence on abstract axis let vect_tail_y1 = ysequence( $2 ) ! Sequence on abstract axis let vect_x_comp1 = ysequence( $3 ) ! Sequence on abstract axis let vect_y_comp1 = ysequence( $4 ) ! Sequence on abstract axis let mag_per_inch = `$5 * 2` let arrowhead_draw = $6"|arrow>0|stick>1|