Class Break by Size

222
1
04-08-2020 06:21 PM
RyanJames1
New Contributor

I was wondering if anyone had an idea about how to break classes by size using sdf.spatial.plot()

The default class break method is by color, however, there should be a way to break classes by size.  I searched the guide and other posts, and have yet to find the proper code.  Here is what I have right now:

sdf = pd.DataFrame.spatial.from_layer(screenings_feature_layer)

sdf.spatial.plot(map_widget = map1,                                        # Map widget variable
                        renderer_type = 'c',                                           # Type of Renderer ("s", "c", "u", etc.)
                        method = "esriClassifyEqualInterval",               # Classification Scheme
                        class_count = 5,                                                # Number of classes
                        col = 'Number_of_',                                           # Field of interest
                        min_value = 1,                                                  # Lower bound of data
                        max_value = max(sdf['Number_of_']),             # Upper bound of data
                        default_symbol = None,                                   # Refers to "Other" values not in specified range
                        alpha = 0.7)

I've tried min_size = , max_size = , and others.

Let me know if you know the answer!  Thanks so much!

0 Kudos
1 Reply
andrei_ste
New Contributor III

Hi Ryan,

I had the same problem and I managed to solve it using the simple renderer with a size variable defined in the visual_variables property. In the code snippet below, date_zi is my spatially enabled dataframe:solution.png

More information related to the size variable you can find  here: https://developers.arcgis.com/documentation/glossary/size-variable

Although the examples provided in the following link are for the Javascript API for ArcGIS, they work also for the Python API since they are both built upon the ArcGIS REST API. The difference is that for the Python API you need each key to be written between commas: https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVar...

0 Kudos