<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Francesco,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you use cnFillPalette, it spans the color map by default.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The warnings are coming from:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">res@gsnSpreadColors = True</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">which is the same idea, but based on an old color scheme that was deprecated when cnFillPalette was introduced.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try deleting or commenting it out. I will see if we can make the documentation more clear on this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 5, 2017 at 8:31 AM, Francesco Trotta <span dir="ltr"><<a href="mailto:francesco.trotta4@unibo.it" target="_blank">francesco.trotta4@unibo.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear ncl-team<br>
I'm try to do a multiplot with 3 plots of a 2dfileds xz with 'gsn_csm_contour'<br>
<br>
but I have this warning:<br>
<br>
warning:ContourPlotSetValues: Y coordinates out of data range: defaulting<br>
warning:ContourPlotSetValues: color index (207) exceeds size of palette, defaulting to foreground color for entry (17)<br>
warning:ContourPlotSetValues: color index (219) exceeds size of palette, defaulting to foreground color for entry (18)<br>
warning:ContourPlotSetValues: color index (231) exceeds size of palette, defaulting to foreground color for entry (19)<br>
warning:ContourPlotSetValues: color index (243) exceeds size of palette, defaulting to foreground color for entry (20)<br>
warning:ContourPlotSetValues: color index (255) exceeds size of palette, defaulting to foreground color for entry (21)<br>
warning:ContourPlotSetValues: Y coordinates out of data range: defaulting<br>
warning:ContourPlotSetValues: color index (207) exceeds size of palette, defaulting to foreground color for entry (17)<br>
warning:ContourPlotSetValues: color index (219) exceeds size of palette, defaulting to foreground color for entry (18)<br>
warning:ContourPlotSetValues: color index (231) exceeds size of palette, defaulting to foreground color for entry (19)<br>
warning:ContourPlotSetValues: color index (243) exceeds size of palette, defaulting to foreground color for entry (20)<br>
warning:ContourPlotSetValues: color index (255) exceeds size of palette, defaulting to foreground color for entry (21)<br>
warning:ContourPlotSetValues: Y coordinates out of data range: defaulting<br>
warning:ContourPlotSetValues: color index (101) exceeds size of palette, defaulting to foreground color for entry (16)<br>
warning:ContourPlotSetValues: color index (107) exceeds size of palette, defaulting to foreground color for entry (17)<br>
warning:ContourPlotSetValues: color index (113) exceeds size of palette, defaulting to foreground color for entry (18)<br>
warning:ContourPlotSetValues: color index (119) exceeds size of palette, defaulting to foreground color for entry (19)<br>
warning:ContourPlotSetValues: color index (125) exceeds size of palette, defaulting to foreground color for entry (20)<br>
warning:ContourPlotSetValues: color index (132) exceeds size of palette, defaulting to foreground color for entry (21)<br>
warning:ContourPlotSetValues: color index (138) exceeds size of palette, defaulting to foreground color for entry (22)<br>
warning:ContourPlotSetValues: color index (144) exceeds size of palette, defaulting to foreground color for entry (23)<br>
warning:ContourPlotSetValues: color index (150) exceeds size of palette, defaulting to foreground color for entry (24)<br>
warning:ContourPlotSetValues: color index (156) exceeds size of palette, defaulting to foreground color for entry (25)<br>
warning:ContourPlotSetValues: color index (162) exceeds size of palette, defaulting to foreground color for entry (26)<br>
warning:ContourPlotSetValues: color index (169) exceeds size of palette, defaulting to foreground color for entry (27)<br>
warning:ContourPlotSetValues: color index (175) exceeds size of palette, defaulting to foreground color for entry (28)<br>
warning:ContourPlotSetValues: color index (181) exceeds size of palette, defaulting to foreground color for entry (29)<br>
warning:ContourPlotSetValues: color index (187) exceeds size of palette, defaulting to foreground color for entry (30)<br>
warning:ContourPlotSetValues: color index (193) exceeds size of palette, defaulting to foreground color for entry (31)<br>
warning:ContourPlotSetValues: color index (199) exceeds size of palette, defaulting to foreground color for entry (32)<br>
warning:ContourPlotSetValues: color index (206) exceeds size of palette, defaulting to foreground color for entry (33)<br>
warning:ContourPlotSetValues: color index (212) exceeds size of palette, defaulting to foreground color for entry (34)<br>
warning:ContourPlotSetValues: color index (218) exceeds size of palette, defaulting to foreground color for entry (35)<br>
warning:ContourPlotSetValues: color index (224) exceeds size of palette, defaulting to foreground color for entry (36)<br>
warning:ContourPlotSetValues: color index (230) exceeds size of palette, defaulting to foreground color for entry (37)<br>
warning:ContourPlotSetValues: color index (236) exceeds size of palette, defaulting to foreground color for entry (38)<br>
warning:ContourPlotSetValues: color index (243) exceeds size of palette, defaulting to foreground color for entry (39)<br>
warning:ContourPlotSetValues: color index (249) exceeds size of palette, defaulting to foreground color for entry (40)<br>
warning:ContourPlotSetValues: color index (255) exceeds size of palette, defaulting to foreground color for entry (41)<br>
<br>
the colormap don't span beetwen the values that I fixed for my 3 plots but there are part of the pannel color which is Black.<br>
<br>
<br>
How can I remove the black color?<br>
<br>
the script that I'm using is the follow:<br>
<br>
nnest = dimsizes(nz(:))<br>
plot = new(nnest,graphic)<br>
bdybox = new((/nnest,5/),graphic)<br>
<br>
;CenterString= (/"Model Nest1","Model Nest2","Difference"/)<br>
CenterString= (/" "," "," "," "/)<br>
<br>
;============== open a file ==============================<wbr>===================<br>
wks = gsn_open_wks(typefile,<wbr>namefile)<br>
<br>
;============== miscellanous ==============================<wbr>==================<br>
;gsn_define_colormap(wks,<wbr>colorsMap)<br>
<br>
;============== map resources ==============================<wbr>=====================<br>
res = True <br>
;--- (gsn) attributes ------------------------------<wbr>--------<br>
res@gsnDraw = False ; don't draw yet<br>
res@gsnFrame = False ; don't advance frame yet<br>
res@gsnAddCyclic = False ; data already has cyclic point<br>
res@gsnSpreadColors = True ; use full colormap<br>
res@gsnLeftStringFontHeightF = 12<br>
;--- (tickMark) attributes ------------------------------<wbr>------<br>
res@tmXBLabelFontHeightF = 0.015 ; resize tick labels<br>
res@tmYLLabelFontHeightF = 0.015 <br>
;res@tmXBTickSpacingF = 0.20 ; label spacing every 60 degrees <br>
;--- (transformation) attributes ------------------------------<wbr>----<br>
res@trYReverse = True ; (adjust Y-axis) reverses y-axis<br>
res@trYTensionF = 9.5 ; This removes the spline warning.<br>
;--- (plotManager) attributes ------------------------------<br>
res@pmTickMarkDisplayMode = "Always"<br>
;--- (contours) attributes ------------------------------<wbr>---<br>
res@cnFillOn = True ; areas between levels filled with color<br>
res@cnFillMode = "AreaFill" ; AreaFill<br>
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels<br>
res@cnLinesOn = False ; turn off the contour lines<br>
res@cnLineLabelsOn = False ; turn off the line labels<br>
res@cnLineLabelFontHeightF= 0.005<br>
res@cnLineLabelDensityF = 1 ; label spacing when cnLineLabelPlacementMode != "Constant"<br>
res@cnLineLabelFontAspectF= 1 ; shape of the line label. > 1 :thinner characters. < 1 :wider<br>
res@cnLineLabelInterval = 1<br>
res@cnInfoLabelOn = False ; turn off "CONTOUR FROM X TO X BY X" legend.<br>
res@cnLabelMasking = True ; mask lines where label appear<br>
;--- (labelBar) attributes ------------------------------<wbr>---<br>
res@lbLabelBarOn = True ; turn off individual label bars <br>
res@lbOrientation = "vertical"<br>
res@lbLabelFontHeightF = 0.015<br>
res@lbLabelStride = 5 ; Label every 5th entry<br>
<br>
do inest=0,nnest-1<br>
;--- (transformation) attributes ------------------------------<wbr>----<br>
res@trYMinF = minDepth(inest) ;min value on y-axis<br>
res@trYMaxF = maxDepth(inest) ;max value on y-axis<br>
;--- (ScalarField) attributes ------------------------------<wbr>-<br>
res@sfXArray = lon1d(inest,0:nx(inest)-1) <br>
res@sfYArray = depth1d(inest,0:nz(inest)-1)<br>
;--- (gsn) attributes ------------------------------<wbr>--<br>
if(lLeftString) then res@gsnLeftString = LeftString(inest)<br>
else res@gsnLeftString = "" end if<br>
if(lRightString) then res@gsnRightString = field@units<br>
else res@gsnRightString = "" end if<br>
res@gsnCenterString = CenterString(inest) <br>
;--- (contours) attributes ------------------------------<wbr>-<br>
cmap = read_colormap_file(colorsMap(<wbr>inest)) <br>
;print(cmap)<br>
res@cnFillPalette = colorsMap(inest) ; Assign a colormap to a contour plot<br>
;print(res@cnFillPalette)<br>
res@cnMinLevelValF = minLevelVal(inest) ; set max contour level<br>
res@cnMaxLevelValF = maxLevelVal(inest) ; set min contour level<br>
res@cnLevelSpacingF = levelSpacing(inest)<br>
;--- (labelBar) attributes ------------------------------<wbr>---<br>
res@lbLabelStrings = "" + sprintf(labformatStr,fspan(<wbr>minLevelVal(inest),<wbr>maxLevelVal(inest), \<br>
<wbr> floattoint((maxLevelVal(inest)<wbr>-minLevelVal(inest))/<wbr>levelSpacing(inest))+1))<br>
<br>
;=== draw map ==============================<wbr>================<br>
plot(inest) = gsn_csm_contour(wks,field2D(<wbr>inest,0:nz(inest)-1,0:nx(<wbr>inest)-1),res)<br>
<br>
delete(res@sfXArray) ; compulsory to delete because of dimensions assigned<br>
delete(res@sfYArray)<br>
delete(res@lbLabelStrings)<br>
delete(cmap)<br>
<br>
end do<br>
<br>
;============== panel resources ==============================<wbr>=====================<br>
res_pnl = True<br>
;--- (gsn) attributes ------------------------------<wbr>--------<br>
res_pnl@gsnMaximize = True ; maximize plots<br>
res_pnl@gsnFrame = False ; don't advance frame yet<br>
res_pnl@gsnPaperOrientation = "landscape"<br>
;--- (labelBar) attributes ------------------------------<wbr>---<br>
res_pnl@gsnPanelLabelBar = False ; common label bar<br>
res_pnl@lbTitleString = labTitleStr+" ("+field2D@units+")"<br>
res_pnl@lbTitlePosition = "Bottom"<br>
res_pnl@lbLabelFontHeightF = 0.0122<br>
res_pnl@lbLabelStride = 5 ; Label every 5th entry<br>
res_pnl@lbTitleFontHeightF = 0.0122<br>
res_pnl@gsnPanelRowSpec = True ;Specify plots per row<br>
<br>
if(iPlOrient.eq.0) then<br>
res_pnl@lbOrientation = "vertical"<br>
else <br>
res_pnl@lbOrientation = "horizontal"<br>
end if<br>
<br>
;=== draw panels ==============================<wbr>==============<br>
if(nnest.eq.1) then<br>
gsn_panel(wks,plot,(/1/),res_<wbr>pnl)<br>
end if<br>
if(nnest.eq.2) then<br>
if(iPlOrient.eq.0) then gsn_panel(wks,plot,(/1,1/),<wbr>res_pnl)<br>
else gsn_panel(wks,plot,(/2/),res_<wbr>pnl) end if<br>
end if<br>
if(nnest.eq.3) then<br>
if(iPlOrient.eq.0) then gsn_panel(wks,plot,(/1,1,1/),<wbr>res_pnl)<br>
else gsn_panel(wks,plot,(/3/),res_<wbr>pnl) end if<br>
end if<br>
;if(nnest.eq.4) then<br>
; gsn_panel(wks,plot,(/2,2/),<wbr>res_pnl)<br>
;end if<br>
if(nnest.eq.4) then<br>
;---Top row <br>
plot_height = 0.5<br>
res_pnl@gsnPanelTop = 1.0 <wbr> ; Make sure each set of plots gets a
<br>
res_pnl@gsnPanelBottom = res_pnl@gsnPanelTop - plot_height ; third of the total height.<br>
res_pnl@gsnPanelYF = (/0.962,0.962/) ; Y position of top of plots<br>
res_pnl@gsnPanelXF = (/0.12,0.62/) ; X position of xxx of plots<br>
gsn_panel(wks,plot(0:1),(/2/),<wbr>res_pnl)<br>
<br>
;---Bottom row<br>
res_pnl@gsnPanelTop = res_pnl@gsnPanelBottom<br>
res_pnl@gsnPanelBottom = 0.0<br>
res_pnl@gsnPanelYF = (/0.462,0.462/) ; Y position of top of plots<br>
res_pnl@gsnPanelXF = (/0.12,0.62/) ; Y position of top of plots<br>
gsn_panel(wks,plot(2:3),(/2/),<wbr>res_pnl)<br>
end if<br>
<br>
;now advance frame for all plots<br>
frame(wks)<br>
</p>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>