Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there some algorithm to map a list of numbers to some that vary less?

I'm working on a bubble chart, and am having trouble calculating the bubble radius.

I want to use a certain quantity to calculate the bubble radius, but the quantity varies a lot. The minimum is 340, maximum is 190000 but most points are between 5000 to 30000. These ranges are too extreme to use the quantity as the radius directly.

Is there any algorithm to "smooth" the curve of the data? Or some method to map the original quantity to a more reasonable one?

Right now my graph is a scatter chart, because I can not translate it to bubble chart without a radius.

like image 388
Jim Avatar asked Oct 31 '22 05:10

Jim


1 Answers

Have you considered using the logarithm of your data? Using base 10 for example, your bounds become

| Original | Log_10 |
|     340  |    2.5 |
|   5,000  |    3.7 |
|  30,000  |    4.5 |
| 190,000  |    5.3 |
like image 163
phs Avatar answered Nov 15 '22 08:11

phs