<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Judy,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The problem is that the map plot is being maximized in the screen before it knows anything about the labelbar, and hence the labelbar associated with the contour plot gets pushed off the right side of the screen.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The quick solution is to first remove this line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><font face="monospace, monospace">mpres.pmLabelBarDisplayMode = 'Conditional'</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and add a call to Ngl.maximize_plot right before Ngl.draw:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="monospace, monospace">#overlay the two plots</font></div><div class="gmail_default" style=""><font face="monospace, monospace">Ngl.overlay(map_plot, iceContour)</font></div><div class="gmail_default" style=""><font face="monospace, monospace">Ngl.overlay(map_plot,iceVectors)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace">Ngl.maximize_plot(wks,map_plot)</font></div><div class="gmail_default" style=""><font face="monospace, monospace">Ngl.draw(map_plot)</font></div><div class="gmail_default" style=""><font face="monospace, monospace">Ngl.frame(wks)</font></div><div style="font-size:small"><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">This causes your map_plot to be resized to fit the screen/PS/PDF/PNG file. The name of this call is a bit of a misnomer, because in this case it's actually going to shrink the plot a little so it fits.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 20, 2016 at 4:00 PM, Judy Twedt <span dir="ltr"><<a href="mailto:judytwedt@gmail.com" target="_blank">judytwedt@gmail.com</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">Hi Mary and Pyngl users,<div><br></div><div>I'm having trouble with labelbars on an overlay plot. I've overlaid a filled contour and a vector plot onto a map plot, and the only way I've been able to get the label bar to display is by setting <font face="monospace, monospace" size="1">mpres.pmLabelBarDisplayMode = 'Conditional' </font>to the map resources. </div><div><br></div><div> The trouble is, now I have two label bars -- one which corresponds to the contour plot, and one generic and meaningless label bar. I've tried fiddling with the lbLabelBarOn switch in all of the resources to no avail. I would greatly appreciate any feedback on how to remove the generic label bar!</div><div><div><br></div><div>Here is the code snippet. </div><div>The file is on yellowstone at:/glade/p/work/jtwedt/cam4som/iceMotionAreaTrend.py</div><div><br></div><div><div><font face="monospace, monospace" size="1">wks = Ngl.open_wks('X11', 'overlay')</font></div><div><font face="monospace, monospace" size="1">rlist = Ngl.Resources()</font></div><div><font face="monospace, monospace" size="1">rlist.wkColorMap = 'precip4_diff_19lev'</font></div><div><font face="monospace, monospace" size="1">Ngl.set_values(wks, rlist)</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">#instantiate resources</font></div><div><font face="monospace, monospace" size="1">mpres = Ngl.Resources()</font></div><div><font face="monospace, monospace" size="1">res = Ngl.Resources()</font></div><div><font face="monospace, monospace" size="1">vcres = Ngl.Resources()</font></div><div><br></div><div><font face="monospace, monospace" size="1">#turn off draw and drame</font></div><div><font face="monospace, monospace" size="1">mpres.nglDraw = False</font></div><div><font face="monospace, monospace" size="1">mpres.nglFrame = False</font></div><div><font face="monospace, monospace" size="1">res.nglDraw = False</font></div><div><font face="monospace, monospace" size="1">res.nglFrame = False</font></div><div><font face="monospace, monospace" size="1">vcres.nglDraw = False</font></div><div><font face="monospace, monospace" size="1">vcres.nglFrame = False</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">#set up coordinate arrays</font></div><div><font face="monospace, monospace" size="1">res.sfXArray = lonT</font></div><div><font face="monospace, monospace" size="1">res.sfYArray = latT</font></div><div><font face="monospace, monospace" size="1">vcres.vfXArray = lonU</font></div><div><font face="monospace, monospace" size="1">vcres.vfYArray = latU</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1"># map resources</font></div><div><font face="monospace, monospace" size="1">mpres.mpOutlineOn = True</font></div><div><font face="monospace, monospace" size="1">mpres.pmLabelBarDisplayMode = 'Conditional'</font></div><div><font face="monospace, monospace" size="1">#mpres.lbMonoFillPattern = True</font></div><div><font face="monospace, monospace" size="1">mpres.mpLimitMode = 'LatLon'</font></div><div><font face="monospace, monospace" size="1">mpres.trGridType = "TriangularMesh"</font></div><div><font face="monospace, monospace" size="1">mpres.mpCenterLatF = -79.</font></div><div><font face="monospace, monospace" size="1">mpres.mpMinLatF = -79.</font></div><div><font face="monospace, monospace" size="1">mpres.mpMaxLatF = -60.</font></div><div><font face="monospace, monospace" size="1">map_plot = Ngl.map(wks, mpres)</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">#contour resources</font></div><div><font face="monospace, monospace" size="1">res.cnLineLabelsOn = False</font></div><div><font face="monospace, monospace" size="1">res.cnFillOn = True</font></div><div><font face="monospace, monospace" size="1">#res.lbLabelBarOn = True</font></div><div><font face="monospace, monospace" size="1">#res.tfPlotManagerOn = True</font></div><div><font face="monospace, monospace" size="1">res.cnLinesOn = False</font></div><div><font face="monospace, monospace" size="1">iceContour = Ngl.contour(wks, ice, res)</font></div><div><div><font face="monospace, monospace" size="1">#vector resources</font></div><div><font face="monospace, monospace" size="1">vcres.vcUseRefAnnoRes = True</font></div><div><font face="monospace, monospace" size="1">vcres.vcGlyphStyle = 'CurlyVector'</font></div><div><font face="monospace, monospace" size="1">#vcres.vcMinFracLengthF = 0.33 # Increase length of</font></div><div><font face="monospace, monospace" size="1">vcres.vcMinMagnitudeF = 1.0 # vectors.</font></div><div><font face="monospace, monospace" size="1">vcres.vcMinDistanceF = 0.02</font></div><div><font face="monospace, monospace" size="1">vcres.vcRefLengthF = 0.04</font></div><div><font face="monospace, monospace" size="1">vcres.vcRefMagnitudeF = 10.0</font></div><div><font face="monospace, monospace" size="1">#vcres.vcRefAnnoOn = False</font></div><div><font face="monospace, monospace" size="1">iceVectors = Ngl.vector(wks, uvel, vvel, vcres)</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">#overlay the two plots</font></div><div><font face="monospace, monospace" size="1">#map_plot.contour = iceContour.base</font></div><div><font face="monospace, monospace" size="1">Ngl.overlay(map_plot, iceContour)</font></div><div><font face="monospace, monospace" size="1">Ngl.overlay(map_plot,iceVectors)</font></div><div><font face="monospace, monospace" size="1">Ngl.draw(map_plot)</font></div><div><font face="monospace, monospace" size="1">Ngl.frame(wks)</font></div><div><font face="monospace, monospace" size="1">Ngl.end()</font><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span></div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-size:12.8px"><font face="times new roman, serif" color="#444444"><i><b>Judy Twedt</b></i></font></span><div style="font-size:12.8px"><br><div><i><font face="times new roman, serif" color="#666666">Graduate Student </font></i></div><div><font face="times new roman, serif" color="#666666"><i style="font-size:12.8px">Department of Atmospheric Sciences</i><br></font></div><div><i><font face="times new roman, serif" color="#666666">University of Washington</font></i></div><div><i><br></i></div></div></div><div><img src="http://www.chasingglennbeck.com/storage/citizens%20united%20protest.jpg?__SQUARESPACE_CACHEVERSION=1340706321282" width="200" height="116"><br></div><div style="font-size:12.8px"><div><i><br></i></div><div><i><br></i></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div>