Updating layer symbology
There may be times when
you will want to change the symbology of a layer in a map document. This can be accomplished through the use of the UpdateLayer()
function, which can be used to change the symbology of a layer as well as various properties of a layer. In this recipe, you will use the UpdateLayer()
function to update the symbology of a layer.
Getting ready
The arcpy.mapping
module also gives you the capability of updating layer symbology from your scripts by using the UpdateLayer()
function. For example, you might want your script to update a layer's symbology from a graduated color to a graduated symbol, as illustrated in the following screenshot. UpdateLayer()
can also be used to update various layer properties, but the default functionality is to update the symbology. Because UpdateLayer()
is a robust function capable of altering both symbology and properties, you do need to understand the various parameters that can be supplied as an input.
How to do it…
Follow...