tags:

views:

123

answers:

1

I'm reading some data for countries around the world and am playing with Google's visualization gadgets, in particular the map visualizations. The problem is, that the US always comes out way in front. While most countries have values between 1 and 50, the US consistently has a value of 2000+. Which means in the visualization, it's hard to tell the difference between all the "small countries", as they all get about the same shade of pale green, while the US always is a fat dark green.

I don't particularly care about the accuracy of the visualization, so I'd like to smooth out or average out the values a bit so that there's a visible difference between the very-low, low and not-so-low countries. What's a good algorithm to do that?

A pretty simple problem, but I'm not a math guy at all. ^_^;;

+12  A: 

How about displaying data on a logarithmic scale. That way a value of 10 translates to 1, a value of 100 translates to 2, 1000 translates to 3 and so on.

James Conigliaro
There you go, learned what log() is good for. ;)Thanks.
deceze
Note that 0 translates to minus infinity, which may cause problems. A practical trick is to take log(1+x) or log(0.001+x) or whatever works for you, or perhaps log(min(1,x)), log(min(0.001,x)), etc.
Jouni K. Seppänen