<div dir="ltr"><div>Hi,</div><div><br></div><div>Try adding these resources to your mpres variable:</div><div><br></div><div> mpres@gsnOldLabelBar = False<br> mpres@lbLabelBarOn = False</div><div><br></div><div>This works for me. I do not have a good explanation for why this is needed. The gsnOldLabelBar is an undocumented, "internal", resource; its set to True by default. I traced into the code far enough to see that there is an interaction with that resource=True and cnFillOn=True. But there must be more to it than that, or otherwise we would see this issue all the time. There's evidently a bug in there somewhere, but I am not in a position to go track it down. <br></div><div><br></div><div>Setting lbLabelBarOn = False is not strictly necessary, but if you don't you'll get a second labelbar that is for the terrain. In the current setup, it partially overlaps the labelbar you are explicitly adding.</div><div><br></div><div>I hope that helps...</div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 14, 2019 at 3:23 PM juki juki <<a href="mailto:juky_emc2@yahoo.com">juky_emc2@yahoo.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-size:13px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><div dir="ltr">line 216 is </div></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><br></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">map = gsn_csm_contour_map(wks,data1T,mpres)</span></span><br></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">This appears when I set:</span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">mpres@cnFillOn = True ; turn on color fill</span></span><br></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">If I set</span></span></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">mpres@cnFillOn = False ; turn on color fill</span></span><br></span></span></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></span></span></span></span></div><div dir="ltr"><font face="monospace"><span style="white-space:pre-wrap">there is no error but I want to have topography background ins the map.</span></font></div><div dir="ltr"><font face="monospace"><span style="white-space:pre-wrap"><br></span></font></div><div dir="ltr"><font face="monospace"><span style="white-space:pre-wrap">Juki</span></font></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap"><br></span></span></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif"><br></div>
</div><div id="gmail-m_3387123338356215764yahoo_quoted_4725716749">
<div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
<div>
On Friday, November 15, 2019, 05:16:20 AM GMT+7, Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="gmail-m_3387123338356215764yiv1283834173"><div><div dir="ltr"><div>What is line 216 in your script? Is that the only error/warning messages?</div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div></div><br clear="none"><div><div id="gmail-m_3387123338356215764yiv1283834173yqt12829"><div dir="ltr">On Thu, Nov 14, 2019 at 2:57 PM juki juki via ncl-talk <<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div dir="ltr">Sorry I re-send my previous question and hope some helps.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Juky</div>
<div><br clear="none"></div><div><br clear="none"></div>
</div><div id="gmail-m_3387123338356215764yiv1283834173gmail-m_1009304302790482284ydpdf274e01yahoo_quoted_4491618026">
<div>
<div>
On Wednesday, November 13, 2019, 09:43:00 PM GMT+7, juki juki via ncl-talk <<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="gmail-m_3387123338356215764yiv1283834173gmail-m_1009304302790482284ydpdf274e01yiv0001319015"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div id="gmail-m_3387123338356215764yiv1283834173gmail-m_1009304302790482284ydpdf274e01yiv0001319015ydp888b0c32yiv5794647535"><div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px">Hi all !</div></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><br clear="none"></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px">I am using the following add labelbar for my contour plot: <span><a rel="nofollow" shape="rect" href="http://www.ncl.ucar.edu/Applications/Scripts/polyg_8_lbar.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/polyg_8_lbar.ncl</a></span></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><br clear="none"></div><div dir="ltr" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px">I am plotting the topography as the background instead of <span></span><pre style="color:rgb(0,0,0);white-space:pre-wrap">map = gsn_csm_map(wks,mpres)</pre><pre style="color:rgb(0,0,0);white-space:pre-wrap">The following is my simple ncl:</pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"></pre><div><div> wks = gsn_open_wks("png","polyg") ; send graphics to PNG file</div><div><br clear="none"></div><div>;---Set up some map resources.</div><div> mpres = True</div><div> mpres@gsnMaximize = False ; Maximize plot in frame.</div><div> mpres@gsnDraw = False ; Will draw later</div><div> mpres@gsnFrame = False ; Don't advance the frame</div><div> ; mpres@pmTickMarkDisplayMode = "Always"</div><div> mpres@gsnAddCyclic = False ; data already has cyclic point</div><div> mpres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines</div><div> mpres@mpDataBaseVersion = "MediumRes" ; Medium resolution database</div><div> mpres@cnFillOn = True ; turn on color fill</div><div> mpres@cnLinesOn = False ; turn of contour lines</div><div> </div><div> mpres@cnLineLabelsOn = False ;-- turns off contour line labels</div><div> mpres@cnInfoLabelOn = False ;-- turns off contour info label </div><div> mpres@cnLevelSelectionMode = "ManualLevels" ; Set contour levels</div><div> mpres@cnMinLevelValF = 200 ; the same for each plot.</div><div> mpres@cnMaxLevelValF = 3000</div><div> mpres@cnLevelSpacingF = 200</div><div><br clear="none"></div><div><br clear="none"></div><div> mpres@mpMinLatF = -7.</div><div> mpres@mpMaxLatF = 7.</div><div> mpres@mpMinLonF = 94.</div><div> mpres@mpMaxLonF = 108.</div><div> mpres@mpShapeMode = "FreeAspect"</div><div> mpres@vpWidthF = 0.35</div><div> mpres@vpHeightF = 0.25</div><div> </div><div> mpres@tmXBLabelFontHeightF = 0.01 ; resize tick labels</div><div> mpres@tmYLLabelFontHeightF = 0.01</div><div> mpres@gsnMajorLatSpacing = 2</div><div> mpres@gsnMajorLonSpacing = 2</div><div> mpres@gsnStringFontHeightF = 0.01 </div><div> </div><div><br clear="none"></div><div> </div><div> map = gsn_csm_contour_map(wks,data1T,mpres)</div><div><br clear="none"></div><div dir="ltr">;<span><span style="color:rgb(0,0,0);font-family:monospace;white-space:pre-wrap">data1T is topography data</span></span></div><div><br clear="none"></div><div>;--Create logical variables to hold the marker resources.</div><div> gsres = True</div><div> gsres@gsMarkerIndex = 16 ; Use filled dots for markers.</div><div>;</div><div>; Loop through each grouping of markers, and draw them one set at</div><div>; a time, assigning the proper color and size with gsn_marker.</div><div>;</div><div> base_size = 0.005</div><div> pmid = new(num_distinct_markers,graphic)</div><div> do i = 0, num_distinct_markers-1</div><div> if (.not.ismissing(lat_new(i,0)))</div><div> gsres@gsMarkerColor = colors(i,:)</div><div> ;gsres@gsMarkerSizeF = base_size * (i+1)/3.</div><div> gsres@gsMarkerSizeF = base_size </div><div> gsres@gsMarkerThicknessF = 0.7*(i+1)</div><div> pmid(i) = gsn_add_polymarker(wks,map,lon_new(i,:),lat_new(i,:),gsres)</div><div> end if</div><div> end do</div><div><br clear="none"></div><div>;---Draw labelbar and advance frame.</div><div> add_labelbar(wks,map,levels,colors)</div><div> draw(map)</div><div> frame(wks)</div></div><div><br clear="none"></div><div dir="ltr">Question: How to turn on the color fill? When I set <span> mpres@cnFillOn = True ; turn on color fill, I got the following error:</span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 7901 in file /usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl</div><div><br clear="none"></div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 11301 in file /usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl</div><div><br clear="none"></div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 216 in file rata.ncl</div><div><br clear="none"></div><div dir="ltr">Thank you for help</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Juky</div><div><br clear="none"></div></div><div dir="ltr"><br clear="none"></div></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><br clear="none"></div><br clear="none"></div></div></div></div></div>_______________________________________________<br clear="none">ncl-talk mailing list<br clear="none"><a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">List instructions, subscriber options, unsubscribe:<br clear="none"><a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div>
</div>
</div></div>_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div></div></div></div>
</div>
</div></div></blockquote></div>