<div dir="ltr">The answer is: since the python program is displaying every other interval, you need to make sure that your total number of intervals is a multiple of two (not -100 to 5, but -100 to 10, for example).<div><br></div><div>I am not sure how to explicitly print out the number of intervals defined by the plotting program, as can be done in NCL.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 5, 2024 at 2:01 PM Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com">barry.h.lynn@gmail.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 dir="ltr"><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> Hello:</span></span></font></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span><br></span></span></font></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span>If someone has experience with using python for setting contours and label bar (boxes with labels), I can't seem to drop the right most label bar box -- it says no_label. I don't believe it should be plotted, as the contour ends at 5.</span></span></font></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">min_val = -</span><span style="font-variant-ligatures:no-common-ligatures">25.</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures">max_val</span><span style="font-variant-ligatures:no-common-ligatures"> = </span><span style="font-variant-ligatures:no-common-ligatures">5.</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>space_val = </span><span style="font-variant-ligatures:no-common-ligatures">3.</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000"><span> </span>res.cnMinLevelValF = min_val</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.cnMaxLevelValF = </span><span style="font-variant-ligatures:no-common-ligatures">max_val</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000"><span> </span>res.cnLevelSpacingF = space_val</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.cnLineThicknessF = </span><span style="font-variant-ligatures:no-common-ligatures">0.</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures"># Don't draw contour lines</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.cnLinesOn = </span><span style="font-variant-ligatures:no-common-ligatures">False</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.lbLabelBarOn = </span><span style="font-variant-ligatures:no-common-ligatures">True</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures">#-- draw a labelbar</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000">#res.lbTitleString = "olr Reflectivity (dBZ)"</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000">#res.lbTitleFontHeightF= .015<span> </span></font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000">#res.lbTitleOffsetF = <span> </span>-0.25 # plus is up</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000">#res.lbTitleOffsetF = <span> </span>-0.75 # plus is up</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.lbLabelAlignment = </span><span style="font-variant-ligatures:no-common-ligatures">"BoxCenters"</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>res.lbLabelStrings = </span><span style="font-variant-ligatures:no-common-ligatures">list</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures">range</span><span style="font-variant-ligatures:no-common-ligatures">(-</span><span style="font-variant-ligatures:no-common-ligatures">25</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures">5</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures">3</span><span style="font-variant-ligatures:no-common-ligatures">))</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000"># Calculate the levels</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>num_intervals = </span><span style="font-variant-ligatures:no-common-ligatures">max_val</span><span style="font-variant-ligatures:no-common-ligatures"> - min_val</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">#levels = np.linspace(min_val * space_coef, (</span><span style="font-variant-ligatures:no-common-ligatures">max_val</span><span style="font-variant-ligatures:no-common-ligatures">+2) * space_coef, num_intervals + 1)[1:-1]</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">#levels = np.linspace(min_val * space_coef, </span><span style="font-variant-ligatures:no-common-ligatures">max_val</span><span style="font-variant-ligatures:no-common-ligatures"> * space_coef, num_intervals)</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>levels = np.linspace(min_val , </span><span style="font-variant-ligatures:no-common-ligatures">max_val</span><span style="font-variant-ligatures:no-common-ligatures">+space_val )</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier;min-height:23px"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000"># Convert levels to string and assign to label bar</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>string_levels = [</span><span style="font-variant-ligatures:no-common-ligatures">str</span><span style="font-variant-ligatures:no-common-ligatures">(level) </span><span style="font-variant-ligatures:no-common-ligatures">for</span><span style="font-variant-ligatures:no-common-ligatures"> level </span><span style="font-variant-ligatures:no-common-ligatures">in</span><span style="font-variant-ligatures:no-common-ligatures"> levels]<span> </span></span><span style="font-variant-ligatures:no-common-ligatures"># Convert levels to strings</span></font></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000"><span> </span>res.lbLabelStrings = string_levels</font></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:Courier"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures">(res.lbLabelStrings)</span></font></p></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior <font color="#000000">Scientist, Lecturer,</font></div><div><div><font color="#000000">The Institute of Earth Sciences, <br>The Hebrew University of Jerusalem, <br>Givat Ram, Jerusalem 91904, Israel <br></font></div><font color="#000000">Tel: 972 547 231 170<br>Fax: (972)-25662581</font></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">https://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior <font color="#000000">Scientist, Lecturer,</font></div><div><div><font color="#000000">The Institute of Earth Sciences, <br>The Hebrew University of Jerusalem, <br>Givat Ram, Jerusalem 91904, Israel <br></font></div><font color="#000000">Tel: 972 547 231 170<br>Fax: (972)-25662581</font></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">https://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>