[ncl-talk] Joint probability distribution in Logarithmic scale

Subrahmanyam Sappati subrahmanyamsappati at gmail.com
Thu Aug 20 00:55:04 MDT 2015


Dear All,

I am able to plot Joint PDF of two sets (data set 1,  data set 2) with
following ncl code (Refer fig - Fig-10.png). Is it possible to plot
normalized Joint PDF in logarithmic scale (10^(n))  ?  (please refer
Ref.png)

Here is my ncl code.

​;-----------------------------------------------------------------------------
; Plot Phase Space Diagram
;----------------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"

begin

dir="./"

;o1=asciiread(dir+"2nd-NELP-Ow199.dat",(/103389/),"float")
;o2=asciiread(dir+"2nd-Diff-N-ELP-Hw-Ow.dat",(/103389/),"float")
o2=asciiread(dir+"cos-angle.dat",(/103389/),"float")
o1=asciiread(dir+"PTC-N31-Hw-Ow.dat",(/103389/),"float")
 printVarSummary(o1)


  opt          = True
  opt at bin_nice = True

  pdf2obs   = pdfxy(o1,o2, 0, 0, opt)         ; 25 is the default
printVarSummary(pdf2obs)
;  print(pdf2obs)

;************************************************
; create plots
;************************************************
;  wks = gsn_open_wks("pdf","FIG-10")               ; open a ps file
  wks = gsn_open_wks("png","FIG-10")               ; open a ps file
;  gsn_define_colormap(wks,"prcp_2")
  gsn_define_colormap(wks,"amwg256")


  res      = True
  res at gsnDraw       = True
  res at gsnFrame      = True
  res at cnInfoLabelOn = False
  res at cnFillOn          = True    ; Turn on color
  res at cnLinesOn         = False
  res at cnLineLabelsOn    = False
  res at lbLabelAutoStride = True
  res at gsnSpreadColors   = True
  res at lbOrientation =   "vertical"          ; vertical label bar

  res at trYMinF = 0.6             ; set minimum Y-axis value
  res at trYMaxF = 1.0             ; set maximum Y-axis value
  res at trXMinF = -0.8             ; set minimum X-axis value
  res at trXMaxF = 1.8            ; set maximum X-axis value


  res at tmXMajorGrid                = True          ; implement x grid
  res at tmXMajorGridThicknessF      = 0.5           ; 2.0 is default
  res at tmXMajorGridLineDashPattern = 2             ; select short dash lines

  res at tmYMajorGrid                = True          ; implement y grid
  res at tmYMajorGridThicknessF      = 0.5           ; 2.0 is default
  res at tmYMajorGridLineDashPattern = 2             ; select short dash lines

  res at cnLevelSelectionMode = "ManualLevels"     ; manually set the contour
levels with the following 3 resources
  res at cnMinLevelValF  = 0.001                     ; set the minimum contour
level
  res at cnMaxLevelValF  = 6.0                     ; set the maximum contour
leve
  res at cnLevelSpacingF = 0.04                     ; set the interval between
contours

  res at tiXAxisString   = "bond Length (A)"
  res at tiYAxisString   = "tragectory"


  plot = gsn_csm_contour (wks,pdf2obs, res)


end


-- 

Subrahmanyam.Sappati
C/o Dr. Prasenjit Ghosh
IISER PUNE
Pin code : 411 008

Phone : +91 94 03 59 35 18
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150820/19e66e2f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ref.png
Type: image/png
Size: 135960 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150820/19e66e2f/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FIG-10.png
Type: image/png
Size: 92796 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150820/19e66e2f/attachment-0001.png 


More information about the ncl-talk mailing list