I have this function works totally fine. But i want to be able to change the font size
def label(wah, field):
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name == wah:
if lyr.supports("LABELCLASSES"):
for lblClass in lyr.labelClasses:
lblClass.expression = "["+field+"]"
lyr.showLabels = True
I have tried something like this but i cannot quite seem to get it to work. The label size is not changing from the code below
lblClass.expression = "<FNT size = '8'>" + "[" + {} + "]" + "</FNT>".format(field)
or
lblClass.expression = '"{}" + [{}] + "{}"'.format("<FNT size = '8'>",field,"</FNT>")
Just for reference when i am calling the function it looks like this:
label("CountyClip", "County")
Can someone help me fix my code?
"<FNT size = '8'>[{0}]</FNT>".format(field)
?