[ncl-talk] markers with diff Colors.

Geeta Geeta geetag54 at yahoo.com
Sat Oct 24 12:20:23 MDT 2015


I have a rainfall (1D array) and I had to plot those with diff colours depending on the range that I have defined. 

I have split my orginal array into smaller arrays and Now I am trying to give different COLORS to each array. 
This is some part of script 
;----------Title res

      res at tiMainString         = fili

      plot = gsn_csm_map(wks,res)
;
;
;---------Adding Markers & Coloring them according to the RF value
    nrf                      = dimsizes(rf)
;    print(nrf)

     res_mark                 = True
     res_mark at gsMarkerIndex   = 1     ; 17 predefined markers available
     res_mark at gsMarkerSizeF   = 0.012

; Breaking up rf array into small arrays depending on their value
;
; ind fn return INDEX (in this case the line NOs when the below is TRUE)
;
      rf0                 =  ind(rf.eq.0.0)
      rf_range0           =  rf(rf0)
      nrf_range0          =  dimsizes(rf_range0)
;      print("rf0 output of ind(rf) while rf_range0 is actual value of rf"+ "    "+rf0+"     "+rf_range0)
      printVarSummary(rf_range0)

      rf1          =  ind(rf.ge.0.1.and.rf.lt.2.5)
      rf_range1    =  rf(rf1)
      nrf_range1   =  dimsizes(rf_range1)
;      print("rf1 output of ind(rf) while rf_range1 is actual value of rf"+ "    "+rf1+"     "+rf_range1)
      printVarSummary(rf_range1)

      rf2            =  ind(rf.ge.2.5.and.rf.lt.7.5)
      rf_range2      =  rf(rf2)
      nrf_range2     =  dimsizes(rf_range2)
      printVarSummary(rf_range2)
;      print("rf2 output of ind(rf) while rf_range2 is actual value of rf"+ "    "+rf2+"     "+rf_range2)

      rf3            =  ind(rf.ge.7.5.and.rf.lt.35.5)
      rf_range3      =  rf(rf3)
      nrf_range3     =  dimsizes(rf_range3)
;      print("rf3 output of ind(rf) while rf_range3 is actual value of rf"+ "    "+rf3+"     "+rf_range3)
      printVarSummary(rf_range3)

      rf4            =  ind(rf.ge.35.5.and.rf.lt.64.5)
      rf_range4      =  rf(rf4)
      nrf_range4     =  dimsizes(rf_range4)
;      print("rf4 output of ind(rf) while rf_range4 is actual value of rf"+ "    "+rf4+"     "+rf_range4)
      printVarSummary(rf_range4)



do n                     = 0, nrf_range0-1
      res_mark at gsMarkerColor  = "Blue"
      str                     = unique_string("polymarker")
      plot@$str$              = gsn_add_polymarker(wks,plot,lon,lat,res_mark)
    end do

     do n                     = 0, nrf_range1-1
      res_mark at gsMarkerColor  = "red"
      str                     = unique_string("polymarker")
      plot@$str$              = gsn_add_polymarker(wks,plot,lon,lat,res_mark)
    end do

draw(plot)frame(wks)
Following things I m not able to sort out and seek suggestions. 
1. I get 227 values corresponding to Range0 (when rf=0.0) plotted in RED. 
                Does it has to do it with draw function???
2. If I want to show the topography/ height of the region, how can I do that.

thanks  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151024/264db8dc/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stn-v5.ncl
Type: application/octet-stream
Size: 7931 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151024/264db8dc/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rf-actual-23052013-mod.txt
Url: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151024/264db8dc/attachment.txt 


More information about the ncl-talk mailing list