gsn_csm_xy (3 lines on one plot)

From: David Adams <dave.k.adams_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 11 2010 - 08:06:56 MDT

Dear All,
should be a simple question, I am just a bit rusty with NCL.
I want to plot 3 timeseries of data points on a single xy graph.

I can plot each one individually fine, but when I try to plot all three only
one shows up.

thanks in advance,
Dave

-------------------------------------ncl
code------------------------------------------
load "/usr/local/lib/ncarg/nclex/gsun/gsn_code.ncl"
load "/usr/local/lib/ncarg/nclex/gsun/gsn_csm.ncl"
load "/usr/local/lib/ncarg/nclscripts/csm/contributed.ncl"
load "/usr/local/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

; Read in Data

ncol = 14
nlvl = 525599

diri = "/home/dadams/Desktop/CPTEC_data/ZF2_swaying_tower/"
fili = "GPS_met_CTT_GIPSY_INPA_NOAA_2009.dat"
ZF2data = asciiread(diri+fili,(/nlvl,ncol/), "float")

julian_day = ZF2data(:,1)
pw_RBDC = ZF2data(:,9)*10.0
pw_INPA = ZF2data(:,12)*10.0
pw_NOAA = ZF2data(:,13)*10.0

julian_day!0 = "julian_day"
pw_RBDC!0 = "julian_day"
pw_INPA!0 = "julian_day"
pw_NOAA!0 = "julian_day"

julian_day&julian_day = julian_day
pw_RBDC&julian_day = julian_day
pw_INPA&julian_day = julian_day
pw_NOAA&julian_day = julian_day

pw_RBDC@units = "mm"
pw_INPA@units = "mm"
pw_NOAA@units = "mm"

; create new data set for plotting the 3 lines on one figure
  data1 = new((/3,dimsizes(julian_day&julian_day)/),float)
  data1(0,:) = pw_INPA
  data1(1,:) = pw_RBDC
  data1(2,:) = pw_NOAA
  data1@units = "mm"
  data1@_FillValue = -9999.99

wks = gsn_open_wks ("pdf","Figure_1") ; open ps or pdf file

; plot figure
  res = True ; plot mods desired
  res@gsnDraw = False
  res@gsnFrame = False

  res@xyMarkLineModes = "markers"
  res@xyMarkers = (/3,3,3/)
  res@xyMarkerColor = (/"blue","black","red"/)
  res@tiYAxisString = "(PWV mm)" ; axis string

  res@trXMaxF = 197.0
  res@trXMinF = 193.0
  res@trYMaxF = 56.0 ; pwv in mm
  res@trYMinF = 32.0

 plot = gsn_csm_xy(wks,julian_day({193:197}),data1(:,{193:197}),res)

     draw(plot)
     frame(wks)
end
---------------------------------------------------------------------------------------------------------------------------------------------

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 11 08:07:02 2010

This archive was generated by hypermail 2.1.8 : Tue Oct 12 2010 - 15:27:00 MDT