[ncl-talk] Panel Label Bar

MELISSA KAZEMI RAD mk1369 at scarletmail.rutgers.edu
Tue Jul 31 16:05:59 MDT 2018


Hi,

I'm trying to create a panel contour plot of cloud liquid water, and I
particularly want to have as many contour levels as possible, i.e. I need
to be able to show the smallest amount of cloud water. In order to do so,
I've set:
res at ContourParameters = (/0.0, max(qc_plane), 0.01 /)

However, the plots that I get don't have any designated color for 0 value.
I use a similar code to produce one such plot (instead of a panel plot),
and it works fine, in the sense that I can divide the panel bar to the
number of contour levels.

Here is my NCL code and the plot that I get: (NCL.6.4.0)

    type = "png"

   wks = gsn_open_wks(type,"Cloud_panel")

   times  = wrf_user_list_times(a)
   time = 166

    p    = wrf_user_getvar(a, "pressure", time)    ; Total Pressure
    z    = wrf_user_getvar(a,"z",time)
    qc   = wrf_user_getvar(a,"QCLOUD", time)

    qc       = qc*1000.
    qc at units = "g/kg"

    res                          = True
    res at NoHeaderFooter           = True

    pltres                  = True
    pltres at PanelPlot        = True
    mpres                   = True

  ; Generate Contours

    height_levels = (/750., 1000., 1200, 1400./)   ; heigth levels to plot
    nlevels         = dimsizes(height_levels)     ; number of height levels
    nplots     = 4
    plots      = new(nplots,"graphic")
    iplot      = 0

    do level  = 0,nlevels-1
       res at cnFillOn            = True
       res at cnFillPalette       = "WhViBlGrYeOrRe"
       res at lbLabelBarOn        = False
       res at cnLinesOn           = False
       res at cnLevelSpacingF     = 0.1

       height = height_levels(level)
       qc_plane = wrf_user_intrp3d(qc,z,"h",height,0.,False)

       res at ContourParameters = (/0.0, max(qc_plane), 0.01 /)

       contour = wrf_contour(a,wks,qc_plane,res)
       pltres at CommonTitle      = True
       pltres at PlotTitle        = height+"m"
       plots(iplot) = wrf_map_overlays(a, wks, (/contour/), pltres, mpres)
       delete(contour)
       iplot = iplot + 1
    end do

  ; Panel the WRF Plots
    pnlres                            = True
    pnlres at txString                   = qc at description + "  (" + qc at units +
")"+ "at" + " at "+  times(time)
    pnlres at gsnPanelYWhiteSpacePercent = 10       ; Add white space b/w
plots.
    pnlres at gsnPanelLabelBar           = True    ; Turn on common labelbar

    pnlres at lbLabelAlignment           = "BoxCenters"
    pnlres at lbLabelsOn           = True
    pnlres at lbPerimOn            = False
    pnlres at lbTitleOn            = False

    pnlres at pmLabelBarWidthF           = 0.6

    gsn_panel(wks,(/plots/),(/2,2/),pnlres)

end

-- 
*Melissa Kazemi Rad*
*Atmospheric Sciences Department*
*Rutgers University*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180731/f3efb1d5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cloud_panel.png
Type: image/png
Size: 148182 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180731/f3efb1d5/attachment.png>


More information about the ncl-talk mailing list