[ncl-talk] smooth contours of a one dimensional variable with spatial attributes

Dennis Shea shea at ucar.edu
Tue Oct 2 17:19:12 MDT 2018


Hi Sam

If all species have the same scale. you may want to use a common label bar.
Also, assign, say, the gsnCenterString resource.

http://www.ncl.ucar.edu/Applications/panel.shtml
example 3

 res at lbLabelBarOn        = False           ; turn off individual lb's

; to have a common label bar, both plots should be set to the same interval
; b/c the label bar is drawn by default from the interval of the first plot.
  res at cnLevelSelectionMode =  "ManualLevels"
  res at cnMinLevelValF       = 0.0
  res at cnMaxLevelValF       = 120.
  res at cnLevelSpacingF      =  10

;---labeling

  var0 at long_name = "V-thingy"  ; will automatically put names closer
to contour plot
  plot(0) = gsn_csm_contour_plot(...var0...)
  var1 at long_name = "T-thingy   ; in the upper left
  plot(1) = gsn_csm_contour_plot(...var1...)
  var2 at long_name = "S-thingy"
  plot(2) = gsn_csm_contour_plot(...var2...)
  var3 at long_name = "L-thingy"
  plot(3) = gsn_csm_contour_plot(...var3...)

or, ?better?

  var0 at gsnCenterString = "V-thingy"
  plot(0) = gsn_csm_contour_plot(...var0...)
  var1 at gsnCenterString = "T-thingy   ; in the upper left
  plot(1) = gsn_csm_contour_plot(...var1...)
  var2 at gsnCenterString = "S-thingy"
  plot(2) = gsn_csm_contour_plot(...var2...)
  var3 at gsnCenterString = "L-thingy"
  plot(3) = gsn_csm_contour_plot(...var3...)

;************************************************
; create panel
;************************************************
  resP                     = True                ; modify the panel plot
  resP at gsnPanelMainString = "CalCOFI cruise spring_2017"
or
  resP at gsnPanelMainString = "CalCOFI cruise spring_2017; larvae/10^2""
 * resP at gsnPanelLabelBar    = True                ; add common colorbar*
 ;*res at lbOrientation        = "Vertical"          ; vertical label bar*
 ;resP at lbLabelFontHeightF   = 0.007               ; make labels smaller

  gsn_panel(wks,plot,(/2,1/),resP)               ; now draw as one plot


===

Also, optionally use  triangular ends instead of rectangular ends

http://www.ncl.ucar.edu/Applications/labelbar.shtml

lb_16.ncl

D


On Tue, Oct 2, 2018 at 4:29 PM Sam McClatchie <smcclatchie at fishocean.info>
wrote:

> Thanks Rick.
>
> I got the "best" smoothing using:
>
> ; smoothing options
> res at cnSmoothingOn = True
> res at cnSmoothingDistanceF = .0001 ; best 0.0001
> res at cnSmoothingTensionF = 7.5 ; best 7.5.
>
> This is the result:
>
> <https://my.pcloud.com/publink/show?code=XZ303e7ZnvTle4yQjxhonxSakHJmHR3YzUmV>
> <https://my.pcloud.com/publink/show?code=XZCAIe7ZthCAvhQXclQFi79D7Tv6xpCASSn7>
>
> "Best" rather subjective, but I tried to optimize the colour transitions
> to reflect reasonable gradients.
>
> Much appreciated,
> Sam
> --
> Sam McClatchie (fisheries oceanographer)
> & Elena Turin (accounting & auditing)
> FishOcean Enterprises
> 38 Upland Rd, Huia, Auckland 0604, New Zealand
> cell: 027 752 8495
> Internet <http://www.fishocean.info>
>
>
> "The time has come", the tui said,
> "to talk of many things:
> Of songs - and ferns - and flowering flax,
> of Pukekos and dreams ..."
>
> (not Lewis Carroll)
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181002/7996bb14/attachment.html>


More information about the ncl-talk mailing list