<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: The behavior of classBreaks.upperBound changes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1473367#M70595</link>
    <description>&lt;P&gt;Sorry, I didn't quite understand what you meant.&lt;BR /&gt;The problem I'm having is that although the upper limit value is set properly as far as I can see in the class tab, the colors don't match it.&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 00:55:09 GMT</pubDate>
    <dc:creator>-_-</dc:creator>
    <dc:date>2024-05-16T00:55:09Z</dc:date>
    <item>
      <title>The behavior of classBreaks.upperBound changes</title>
      <link>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1417959#M70510</link>
      <description>&lt;P&gt;I'm trying to set the minimum and maximum values for a graduated color layer with a script tool. (This is a slightly more complicated piece of code)&lt;BR /&gt;Below is the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;glyr=arcpy.GetParameterAsText(0)

glyrlist=glyr.split("\\")
glp=glyrlist[0]
lyr=glyrlist[-1]

aprx=arcpy.mp.ArcGISProject("CURRENT")
activelayout=aprx.activeView
mpflames=activelayout.listElements("MAPFRAME_ELEMENT")[0]
maps=mpflames.map

lays=maps.listLayers(lyr)
for ly in lays:
    if "\\" in ly.longName:
        if ly.longName.split("\\")[0]==glp:
            l=ly
    else:
        l=ly

sym=l.symbology
if hasattr(sym,'renderer'):
    if sym.renderer.type=="GraduatedColorsRenderer" or sym.renderer.type == "GraduatedSymbolsRenderer":
#min
        l_cim=l.getDefinition('V3')
        l_cim.renderer.minimumBreak=-100000000
        l.setDefinition(l_cim)
#max
        sym=l.symbology
        sym.renderer.classBreaks[-1].upperBound=100000000
        l.symbology=sym&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works as desired when you set up a layer with three or more classes.&lt;BR /&gt;However, when the number of classes is 2, the behavior becomes strange as shown in the figure. Also, at this time, if you change "100000000" on line 29 to "1000000", it will work properly.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="タイトルなし3.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102788iE6E14006608AC5F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="タイトルなし3.png" alt="タイトルなし3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="タイトルなし4.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102789iA40823DED6D3EADF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="タイトルなし4.png" alt="タイトルなし4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Why does this happen?&lt;/P&gt;&lt;P&gt;The image below shows a slightly more complex code.&lt;BR /&gt;The color of the "3" square has changed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="タイトルなし.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102791iEC5DD59ACBC3A123/image-size/medium?v=v2&amp;amp;px=400" role="button" title="タイトルなし.png" alt="タイトルなし.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="タイトルなし2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102792i99C82BF22DDCF318/image-size/medium?v=v2&amp;amp;px=400" role="button" title="タイトルなし2.png" alt="タイトルなし2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know the cause of this either.&lt;/P&gt;&lt;P&gt;Is there any way to solve it? thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 07:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1417959#M70510</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2024-05-02T07:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: The behavior of classBreaks.upperBound changes</title>
      <link>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1417970#M70511</link>
      <description>&lt;P&gt;perhaps you understand this comment&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you change upperBound of a ClassBreak, the classificationMethod automatically changes to ManualInterval. You also need to manually update the labels and/or descriptions accordingly.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;in&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/graduatedcolorsrenderer-class.htm" target="_blank"&gt;GraduatedColorsRenderer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;code example 2 gives an example&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 08:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1417970#M70511</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-05-02T08:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: The behavior of classBreaks.upperBound changes</title>
      <link>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1473367#M70595</link>
      <description>&lt;P&gt;Sorry, I didn't quite understand what you meant.&lt;BR /&gt;The problem I'm having is that although the upper limit value is set properly as far as I can see in the class tab, the colors don't match it.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 00:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/the-behavior-of-classbreaks-upperbound-changes/m-p/1473367#M70595</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2024-05-16T00:55:09Z</dc:date>
    </item>
  </channel>
</rss>

