I am trying to export specific layers from an ArcMap .mxd. From the TOC below I would like to export "irrig_2, citylyr, boundlyr" as a GIF. Once this is done the script would then export "irrig_1, citylyr, boundlyr" as another GIF and so on. If possible, the script would also export a legend that corresponds to the layers being exported. I'm not sure if it's a good place to start, but I'm trying to work off the code below.
import arcpy
mxd = arcpy.mapping.MapDocument(r"E:\IrrigatedLands\FC_test\irrig2.mxd")
df = arcpy.mapping.ListDataFrames(mxd, '')[0]
GIFPath = r"E:\IrrigatedLands\FC_test"
for lyr in arcpy.mapping.ListLayers(mxd, '', df):
if lyr.name == "citylyr":
lyr.visible = True
if lyr.name == "boundlyr":
lyr.visible = True
if lyr.name == lyr:
lyr.visible = True
arcpy.mapping.ExportToGIF(mxd,GIFPath+"\\" + lyr.name + ".gif")
lyr.visible = False
arcpy.RefreshActiveView()
del mxd