Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set symbology and exported each raster in my mxd (one by one) to jpg file. My script is ok and it works (it is shown at the bottom).

The question is: how can I customly set my legend?

Now I have those standard labels ("High: #max.number" and "Low: #min.number"), see the image link.

Is it possible to use a python script that sets labels different, for example "Max. value: #maximum number" and "Min. value: #minimum number"?

I have 200 images and renaming each legend is time consuming...

image link (example):

enter image description here

for lyr in arcpy.mapping.ListLayers(mxd):
    arcpy.ApplySymbologyFromLayer_management(lyr, "my_first_layer")
for lyr in arcpy.mapping.ListLayers(mxd):
    #turn off all layers
    lyr.visible = False
for lyr in arcpy.mapping.ListLayers(mxd):
    #turn one layer on at a time and export ...
    lyr.visible = True<BR>
    arcpy.mapping.ExportToJPEG(mxd, "D:\\Users\\JPG_FILES\\"+ 
    lyr.visible = False
share|improve this question

If you are using ArcGIS 10.1 then the new RasterClassifiedSymbology class of arcpy.mapping may be what you need to look at.

share|improve this answer
Yeah, 10.0 does not have this option. – Tomek Oct 23 '12 at 10:02
thank you for the advice. but it doesn't help. i don't have classidfied symbology. i have stretched symbology. when i check lyr.symbologyType it returns me "OTHER". – Rok Oct 23 '12 at 12:23

Your Answer


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.