Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to figure out how to apply graduated color symbology to a feature class by using arcpy.mapping in ArcMap 10.1.

To start, a script runs and a feature class is added to a map document, no problem. This feature class needs the graduated colors. The value field used for the graduated colors is created during the script.

In order to apply the graduated colors, I have to create a layer file from the feature class. This is where I start to get confused. I know UpdateLayer has to be used, and I have to base the update on a source layer? I tried this with no luck.

If someone can just guide me on what order the steps are to apply a graduated color symbology to a feature class using arcpy.mapping, it will be appreciated. I should be able to figure out the rest of the scripting. Thanks!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I haven't tried this personally, but it looks like you need to access the GraduatedColorsSymbology class on the layer. Have a look at the second example at the bottom of this page.

It also looks like you may need to have an existing lyr file with the graduated colours already set in order to use UpdateLayer.

share|improve this answer
    
@dubch87 I agree - through ArcPy you can only change the field used by an existing GraduatedColorsSymbology not assign one to a layer symbolised another way. –  PolyGeo Apr 24 '13 at 9:56
    
arcpy.ApplySymbologyFromLayer_management worked for me. I was then able to use UpdateLayer with the correct break values and labels. –  dubch87 Apr 25 '13 at 21:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.