about gsn_add_polymarker and gsn_add_polyline

From: Jing YANG (yangjing AT mail.iap.ac.cn)
Date: Tue Jun 21 2005 - 21:31:32 MDT


Hi, Everybody

Now I am trying to mark tropical cyclone track overlaid on some shaded fields with "gsn_add_polymarker" and "gsn_add_polyline"
But I am puzzled why I can not add dots and lines on the plot. My NCL scripit is as follows:
***********************************************************************************
.....

  sst!0= "lat"
  sst&lat = f1->lat
  sst!1 = "lon"
  sst&lon = f1->lon
  sst!2 = "mo"

  wks = gsn_open_wks("ps","tt-98-jul") ; open a ps file
  gsn_define_colormap(wks,"wh-bl-gr-ye-re") ; choose a colormap
  res = True ; use plot options
  res@gsnDraw = False
  res@gsnFrame = False
  res@cnFillOn = True ; Fill contours
  res@gsnSpreadColors = True ; use full range of colors

  res@mpMaxLatF = 40.
  res@mpMinLatF = 0.
  res@mpMaxLonF = 140.
  res@mpMinLonF = 100.

;adding TC track
   y1 = (/17,20,23,25/)
   x1 = (/32,29,24,21/)

  dot = new(4,graphic)
  dot_line = new(4,graphic)

   polyres = True
   polyres@gsLineThicknessF = 8.0 ; 2.0 thickness of lines
   polyres@gsLineColor = "white" ; color of lines
   polyres@gsMarkerColor = "white" ; color of lines
   polyres@xyMarker = 16 ; 14 polymarker style
   polyres@gsMarkerIndex = 14 ; 14 polymarker style
   polyres@gsMarkerSizeF = 0.1 ; polymarker size

  plot = gsn_csm_contour_map_ce(wks,sst(:,:,1),res)

  do i = 0,2
    dot(i)=gsn_add_polymarker(wks,plot,x1(i:i+1),y1(i:i+1),polyres)
    dot_line(i)=gsn_add_polyline(wks,plot,x1(i:i+1),y1(i:i+1),plres)
  end do

   draw(plot)
   frame(wks)
###################################################################################

whatever I change y1 and x1 to, it failed to mark TC on the panel.
Thanks for your help!

Jing

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Wed Jun 22 2005 - 10:02:06 MDT