<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body 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 =================================================<br>
wks = gsn_open_wks(typefile,namefile)<br>
<br>
;============== miscellanous ================================================<br>
;gsn_define_colormap(wks,colorsMap)<br>
<br>
;============== map resources ===================================================<br>
res = True <br>
;--- (gsn) attributes --------------------------------------<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 ------------------------------------<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 ----------------------------------<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 ---------------------------------<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 ---------------------------------<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 ----------------------------------<br>
res@trYMinF = minDepth(inest) ;min value on y-axis<br>
res@trYMaxF = maxDepth(inest) ;max value on y-axis<br>
;--- (ScalarField) attributes -------------------------------<br>
res@sfXArray = lon1d(inest,0:nx(inest)-1) <br>
res@sfYArray = depth1d(inest,0:nz(inest)-1)<br>
;--- (gsn) attributes --------------------------------<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 -------------------------------<br>
cmap = read_colormap_file(colorsMap(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 ---------------------------------<br>
res@lbLabelStrings = "" + sprintf(labformatStr,fspan(minLevelVal(inest),maxLevelVal(inest), \<br>
floattoint((maxLevelVal(inest)-minLevelVal(inest))/levelSpacing(inest))+1))<br>
<br>
;=== draw map ==============================================<br>
plot(inest) = gsn_csm_contour(wks,field2D(inest,0:nz(inest)-1,0:nx(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 ===================================================<br>
res_pnl = True<br>
;--- (gsn) attributes --------------------------------------<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 ---------------------------------<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 ============================================<br>
if(nnest.eq.1) then<br>
gsn_panel(wks,plot,(/1/),res_pnl)<br>
end if<br>
if(nnest.eq.2) then<br>
if(iPlOrient.eq.0) then gsn_panel(wks,plot,(/1,1/),res_pnl)<br>
else gsn_panel(wks,plot,(/2/),res_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/),res_pnl)<br>
else gsn_panel(wks,plot,(/3/),res_pnl) end if<br>
end if<br>
;if(nnest.eq.4) then<br>
; gsn_panel(wks,plot,(/2,2/),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 ; 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/),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/),res_pnl)<br>
end if<br>
<br>
;now advance frame for all plots<br>
frame(wks)<br>
</p>
</body>
</html>