[ncl-talk] Multi-line plot with different time length of data

S Br sbr.climate at gmail.com
Thu May 30 08:36:39 MDT 2019


Hi All,
I am doing a multi-line plot with 5 different sets of data. All my data has
annual mean values.
4 sets of data extends for the period 850-2005, where as the 1 sets of data
extends for the period 862-2005.
In the line plot, the first 4 sets of data should start at year 850, where
the 5th line should start at year 862. I am doing following things but all
line starts from year 850.
Could you please suggest how to start first 4 lines from 850 and the 5th
line from year 862.

  temp1           =  f1->tos(:,0,0)
  printVarSummary (temp1)
  temp2           =  f2->tos(:,0,0)
  temp3           =  f3->tos(:,0,0)
  temp4           =  f4->tos(:,0,0)
  temp5           =  f5->tos(:,0,0)

  time = ispan(850,2005,1)
  time at long_name = "Time"

  data            = new((/5,1156/),float)
  data(0,0:1155)  = temp1
  data(1,0:1155)  = temp2
  data(2,0:1155)  = temp3
  data(3,0:1155)  = temp4
  data(4,0:1138)  = temp5

wks =  gsn_open_wks("X11", "Multiline_NCL")

res = True
  res at xyXStyle               = "Time"

;-- create plot
  plot = gsn_csm_xy(wks,time,data,res)

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190530/49a26f50/attachment.html>


More information about the ncl-talk mailing list