I'm using this python script as an expression for labeling in ArcMap:
def FindLabel ( [volkorrekt] ):
if [volkorrekt] >= '5':
return "<FNT size = '20'>"+ str( [volkorrekt] )+"</FNT>"
elif [volkorrekt] >= '2':
return "<FNT size = '14'>"+ str( [volkorrekt] )+"</FNT>"
elif [volkorrekt] >= '1':
return "<FNT size = '8'>"+ str( [volkorrekt] )+"</FNT>"
else:
return ""
I want ArcMap to only label the feature if the value volkorrekt
is bigger than 1, this is working. I also want ArcMap to change the font size according to my if-statement (font size 20 if value >= 5, 14 if >= 2 and 8 if >= 1) but this only works for some but not for all features.
This is my current result:
Examples for wrong labels: The "19,487..." is displayed very small though it's one of the biggest values, the "9,552..." however is displayed much to large.
How can I get ArcMap to label the features in the way I described?