[ncl-talk] Sub: Plot empty...(No fillings)

Mary Haley haley at ucar.edu
Thu Sep 21 16:41:00 MDT 2017


Dz,

When we are asked to look at a script for potential errors, it helps if you
send a clean and short script that illustrates the problem. This is
especially true if we don't have access to your data.

Your script has a lot of commented code, and it is also using gsn_panel to
plot just one figure, when this is normally used to plot multiple figures.
It's hard to tell where the problem could be.

An empty plot can be the result of many things:


   - All missing data
   - contour levels that are out-of-range of the data
   - bad coordinate arrays
   - coordinate arrays that are out-of-range of the area you are requesting
   - etc

How is zAvg being calculated? Did you look at it after you calculated it?
That is, did you use printVarSummary to look at its metadata? Did you look
at the min/max of the data?

printVarSummary(zAvg)
printMinMax(zAvg,0)

Are you getting any errors when you run this script?

Please see this examples page which explains various things you need to
look for in order to plot your data correctly:

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

If you still have problems, then please post back to ncl-talk with
follow-up.

Thanks, and good luck,

--Mary


On Sat, Sep 16, 2017 at 9:32 PM, dale zuri <dalezuri at gmail.com> wrote:

> Hi,
> I checked the output numbers. Those values are  fine and ranging from 0-4.
> But the plot is empty. I would appreciate any help and suggestions.
>
> Thanks
> Dz
> ;;;;;;;;;;;Plot properties;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>    wks  = gsn_open_wks("x11",Out)       ; specifies a ps plot
> gsn_define_colormap(wks,""+col+"")
>  plot = new(1,graphic)
>    res                       = True
> res at gsnDraw             = False
>    res at gsnMaximize           = True             ; make large
>    res at gsnFrame           =  False            ; make large
>    res at cnFillOn              = True             ; turn on color
>    res at cnLinesOn             = False            ; turn off contour lines
>    res at cnLineLabelsOn        = False            ; turn off contour line
> labels
>    res at cnInfoLabelOn       = False
> res at lbLabelBarOn        = False           ; turn off individual cb's
>
> res at gsnTickMarksOn = False
> res at mpGridAndLimbOn       = False
>
>    res at cnLevelSelectionMode  = "ManualLevels"   ; set manual contour
> levels
>    res at cnMinLevelValF        =  0            ; set min contour level
>    res at cnMaxLevelValF        =   4           ; set max contour level
>    res at cnLevelSpacingF       =   0.5          ; set contour interval
>    res at gsnAddCyclic          =  False
>    res at mpFillOn              = False            ; turn off default
> background gray
>  res at mpLimitMode         = "Corners"
>
>   res at mpRelativeCenterLon = True
>
>   res at mpCenterLonF        = -152.2044
>
>   res at mpRelativeCenterLat = True
>
>   res at mpCenterLatF        = 90.
>
>   res at mpRightCornerLonF   = -103.99817
>
>   res at mpRightCornerLatF   = 67.58854
>
> ;  res at mpLeftCornerLonF    = -181.7859
>   res at mpLeftCornerLonF    = -159.0859
>
>   res at mpLeftCornerLatF    = 43.23277
> res at mpGeophysicalLineThicknessF = 3.0
> res at mpGeophysicalLineColor = "Black"; (/22/)
> ;res at mpNationalLineThicknessF  = 3.0
> res at mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state
> boundaries
> res at mpNationalLineColor  = res at mpGeophysicalLineColor
> res at mpUSStateLineThicknessF = 3.0
> res at mpUSStateLineColor  = res at mpGeophysicalLineColor
> res at gsnStringFont   = "helvetica-bold"
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ; res at gsnCenterString       = year(0)+"-"+year(nyrs-1)
>   res at gsnLeftString   = ""               ; add the gsn titles
>   res at gsnRightString  = ""
> ;   res at tiMainString          = "Trend, Reanalysis-2m
> Temperature(~S~o~N~C)"    ; fili
> ;res at tiMainFontHeightF  = 0.02
> res at gsnCenterStringFontHeightF     = 0.020
> res at gsnCenterString     = "A-Clim-"+mon+""+yr+""
>
> plot = gsn_csm_contour_map_ce(wks,zAvg,res)
>
> ;************************************************
> ; create panel
> ;************************************************
>  resP                  = True                   ; modify the panel plot
>  resP at gsnPanelLabelBar = True
>  resP at lbLabelFontHeightF = 0.020                ; set font height of
> Label Bar labels
>  resP at gsnPanelBottom   = 0.2                    ; shrink panel plot by
> setting bottom edge of plot
>  resP at gsnPanelTop      = 0.9                    ; shrink panel plot by
> setting top edge of plot
>  resP at pmLabelBarWidthF  = 0.55                 ; make thinner
> ;  resP at pmLabelBarHeightF = 0.05
>  resP at pmLabelBarHeightF = 0.1
>  resP at gsnPanelYWhiteSpacePercent = 5.           ; increase spacing along
> Y-axis between panel plots
>  resP at cnLinesOn       = False                   ; turn off contour lines
> ;  resP at lbTitleString    = "2m-temperature(~S~o~N~C)"
>   resP at lbTitleString    = ""+unit+""
>   resP at lbLabelFont    = "helvetica-bold"          ; add common colorbar
>   resP at lbTitleFont    = "helvetica-bold"          ; add common colorbar
>   resP at lbTitleFontHeightF= .025                 ; make title smaller
>    resP at cnLineLabelsOn  = False
>
>   resP at txFontHeightF   = 0.03
>   resP at txFont   = "helvetica-bold"
>   ;resP at txString   = ""+Ind+"-"+Initial+""
>   gsn_panel(wks,plot,(/1,1/),resP)               ; now draw as one pl
> end
>
> _______________________________________________
> 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/20170921/b76c0e2a/attachment.html>


More information about the ncl-talk mailing list