Re: polyline help

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 13 May 2009 08:18:14 -0600 (MDT)

Hi James,

Usually when a polyline doesn't show up on a map, the first thing I
check is that I'm passing the longitude, latitude points in the
correct order to gsn_add_polyline.

That is, "xp" should be your longitude, and "yp" your latitude.

I can't tell from your code what the "plane" values are, but
double-check that they are what you expect.

Secondly, a common mistake that people make is they call
gsn_add_polyline with:

      dum = gsn_add_polyline(wks,plot,(/xp1,yp1/),(/xp2,yp2/),resp)

thinking that they are supposed to pass in pairs of (x,y) points.
This is not correct, it should be:

      dum = gsn_add_polyline(wks,plot,(/xp1,xp2/),(/yp1,yp2/),resp)

Of course, if you have more points in your line, then it would be:

  dum = gsn_add_polyline(wks,plot,(/x1,x2,...,xn/),(/y1,y2,...,yn/),res)

--Mary

On Wed, 13 May 2009, Correia, James wrote:

> Hi-
> I am having some serious trouble drawing a polyline using gsn_add_polyline. The map appears but not the line. There is no error, just a map with no line.
>
> ; show map with the cross section line
> resa = True
> WRF_map_c(a, resa, 0) ; reads info from file
> resa_at_tfDoNDCOverlay = True
> resa_at_gsnMaximize = True ; maximize size
> resa_at_gsnSpreadColors = True ; use full range of colormap
> resa_at_gsnScalarContour = True ; contours desired
>
> resa_at_cnFillMode = "RasterFill" ; raster
> resa_at_cnLevelSelectionMode = "ExplicitLevels" ; explicit [unequal] cn levels
>
> resa_at_vcGlyphStyle = "WindBarb"
> resa_at_vcRefLengthF = 0.025 ; ref vec length
> resa_at_vcMinDistanceF = 0.02 ; larger means sparser
> resa_at_vcWindBarbTickLengthF = 0.3 ; default 0.3
> resa_at_vcRefAnnoOn = False
> qlevs = (/0,1,2,3/)
> resa_at_mpGeophysicalLineThicknessF = 2.0
> resa_at_mpUSStateLineThicknessF = 2.0
>
> resa_at_gsnLeftString = "Wind Vectors (m/s), Temp, Hght"
> resa_at_gsnRightString = "MYJ"
> resa_at_gsnDraw = False
> resa_at_gsnFrame = False
> print("plotting")
> plota = gsn_csm_map(wks,resa)
> resp = True
> resp_at_gsLineColor = "Black"
> resp_at_gsLineThicknessF = 2.0
> resp_at_gsLineLabelString = "A"
>
> xp = (/plane(0),plane(2)/)
> yp = (/plane(1),plane(3)/)
> print("dum")
> dum = gsn_add_polyline(wks,plota,xp,yp,resp)
> print("frame")
> draw(plota)
> frame(wks)
>
>
>
> James Correia Jr
> Post Doc
> PH: 372-6463
> james.correia_at_pnl.gov
>
> "Wisdom. Strength. Courage. Generosity. Each of us are born with one of these. We must find the other three inside of us."
> -from "Into the West"
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 13 2009 - 08:18:14 MDT

This archive was generated by hypermail 2.2.0 : Wed May 13 2009 - 08:40:16 MDT