Re: pcolor for NCL?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun, 26 Apr 2009 14:07:26 -0600

I am 99.99% sure the climode.temp_65w.ps was generated
by NCL!!!! The label bar is 'classic' NCL.

General case

Consider an array (say) X(time,z,lat,lon) and another
array containing (say) depth, D(time, z, lat,lon)
where the 'size' of time is 12 [12 months]. Your figure
indicates a vertical cross section at some longitude
(say, LON) for 10N to 45N.

       ntim = 12
       month = (/"JAN","FEB",....,"DEC"/)

       plot = new (ntim, "graphic")

       res_at_trGridType = "TriangularMesh"
     ;;res_at_cnFillMode = "RasterFill" ; Raster Mode faster
     ;;res_at_cnRasterSmoothingOn = True

       res_at_cnFillOn = True
       res_at_cnLinesOn = False
       res_at_cnLineLabelsOn = False
       res_at_gsnSpreadColors = True
       res_at_lbLabelBarOn = False ; turn off individual lb's

       res_at_cnLevelSelectionMode = "ManualLevels"
       res_at_cnMinLevelValF = 0.
       res_at_cnMaxLevelValF = 24.
       res_at_cnLevelSpacingF = 2.

       res_at_trYMinF = 0.0
       res_at_trYMaxF = 2000.
       res_at_trYReverse = True

       latS = 10.
       latN = 45.
       LON = 330. ; some longitude

       do nt=0,ntim-1
          res_at_sfXArray = conform(X(nt,:,{latS:latN},{LON}), lat, 1)
          res_at_sfYArray = D(nt,:,{latS:latN},{LON})

          res_at_gsnLeftString = month(nt)
          plot(nt) = gsn_csm_contour (wks, X(nt,:,{latS:latN},{LON}),res)
       end do

;************************************************
; create panel
;************************************************
       resP = True plot
       resP_at_txString = "....."
       resP_at_gsnPanelLabelBar = True ; add common colorbar
       gsn_panel(wks,plot,(/4,3/),resP) ; now draw as one plot

Sang-Ki Lee wrote:
> Mary Haley wrote:
>> Sang-Ki,
>>
>> I need more information; I'm not sure what you mean by variable
>> colors in each polygon.
>>
>> Do you have sample image created by Matlab that I can look at?
>>
>> --Mary
>
> Mary,
>
> An example plot can be found at:
>
> ftp.aoml.noaa.gov/phod/pub/sklee/pub/ncl-talk/climode.temp_65w.ps
>
> Lines represent interface between two adjacent layers. In each layer,
> the layer temperature varies horizontally. So, there can be
> discontinuity at layer interfaces.
>
> To get his plot, I had to interpolate layer temperature into
> z-coordinate at 10m interval, then do raster filling. It looks ok.
> But, I was wondering if there is a better way to do it.
>
> A mathlab user told me that this can be achieved by using pcolor
> function. Here is an example plot using pcolor:
>
> ftp.aoml.noaa.gov/phod/pub/sklee/pub/ncl-talk/pcolor.jpg
>
> Thank you.
>
> Sang-Ki
>
> P.S. BTW, this model is MICOM.
>
>>> Hi,
>>>
>>> I have output from a layer ocean model. For each layer,
>>> temperature varies horizontally.
>>>
>>> If I want to show a vertical cross section using Mathlab,
>>> I can use "pcolor" function. Basically, pcolor represents
>>> each layer as polygon, but with variable colors in each
>>> polygon. Does NCL has any function similar?
>>>
>>> Thanks.
>>>
>>> Sang-Ki
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Apr 26 2009 - 14:07:26 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 30 2009 - 15:56:01 MDT