[ncl-talk] plot will not draw with cnSmoothingOn=True

Andy Penny andybpenny at hotmail.com
Wed Sep 7 06:47:56 MDT 2016


Hi there,

I'm trying to make a hovmoller plot with shading and contours. However, when I set "cres at cnSmoothingOn = True" for the contours, the script will hang when it tries to draw the plot- it doesn't reach the "RIGHT AFTER DRAW PLOT" print statement. The script works fine when "cres at cnSmoothingOn = False". I'm using NCL version 6.3.0 (ncl_ncarg-6.3.0.Linux_RHEL6.4_x86_64_nodap_gcc447.tar.gz). I've pasted the script below, and have attached the script and data file.

Thanks in advance for any help,
Andy

-------------

begin

  a = addfile("./test_data.nc","r")
  var           = a->var
  var_filter    = a->var_filter

;#### Create Workstation ####
  plotname  = "test"
  wks = gsn_open_wks("png", plotname)

;#### Define Color Map ####
  gsn_define_colormap(wks, "ncl_default")

;#### Shading Resources ####
  res                           = True
  res at cnFillOn                  = True
  res at cnLinesOn                 = False
  res at cnLineLabelsOn            = False
  res at cnSmoothingOn             = True
  res at gsnDraw                   = False
  res at gsnFrame                  = False
  res at gsnSpreadColors           = True

;#### Contour Resources ####
  cres                                  = res
  cres at cnFillOn                         = False
  cres at gsnContourNegLineDashPattern     = 1
  cres at cnLinesOn                        = True
  cres at cnSmoothingOn                    = True              ; if set to True, plot will not draw
  cres at cnLineLabelsOn                   = False
  cres at cnLevelSelectionMode             = "ExplicitLevels"
  cres at cnLineColor                      = "black"
  cres at cnInfoLabelOn                    = False
  cres at cnLineThicknessF                 = 3.0

;#### Create Plot ####
  plot_var                  = gsn_csm_hov(wks, var, res)
  plot_var_filter           = gsn_csm_hov(wks, var_filter, cres)
  overlay(plot_var,plot_var_filter)

  print("RIGHT BEFORE DRAW PLOT")
  draw(plot_var)
  print("RIGHT AFTER DRAW PLOT")

  frame(wks)
  delete(wks)

end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160907/30b493d6/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_plot.ncl
Type: text/x-ncl
Size: 1470 bytes
Desc: test_plot.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160907/30b493d6/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_data.nc
Type: application/x-netcdf
Size: 874892 bytes
Desc: test_data.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160907/30b493d6/attachment-0001.nc 


More information about the ncl-talk mailing list