I am plotting a map that shows the number of tweets by country. The countries with high number of tweets are supposed to be in dark color, while the low in light color. I am scaling the data based max_count
of tweets value through conditional log scale (code below) in order to have a good distinction between color shades. However, I am not getting the result I want (countries with highly different values having same color shades). Any suggestions of how to do a good conditional log scaling?
if max_count > 10000000:
max_scale = math.log(max_count, 1.0001)
elif max_count > 1000000:
max_scale = math.log(max_count, 1.001)
elif max_count > 100000:
max_scale = math.log(max_count, 1.005)
elif max_count > 50000:
max_scale = math.log(max_count, 1.01)
elif max_count > 10000:
max_scale = math.log(max_count, 1.1)
elif max_count > 1000:
max_scale = math.log(max_count, 1.5)
else:
max_scale = math.log(max_count, 1.7)
I should be getting result like this: map image where you can see clear color distinction between big and lower values.