Town Cloud

This project is loosely based on the famous world map by Ethan A. Merritt. Gnuplot can not only plot bars and lines, but also labels - just what we need for this project. I parsed a few place names and locations from Wikipedia or (for the larger maps) from OpenGeoDB, and plotted them in appropriate size to their location. Optionally, I color coded the labels similar to the color scheme of topological maps.

Gallery

These are the Town Clouds I created so far.

Code

This is the plot file for the Saarland map:

set terminal postscript enhanced "Helvetica" color
set output './towns.ps'
set encoding iso_8859_15
set palette model RGB functions 1.0-6*(gray-0.7)**2, 0.8-1.5*(gray-0.5)**2, (0.4-gray)
set xrange [6.3:7.5]
set yrange [49.05:49.65]
set cbrange [180:460]
unset colorbox
unset xtics
unset ytics
unset key
CityName(String,Size) = sprintf("{/=%d %s}", Size**0.35/2, String)
plot 'towns' using 2:1:(CityName(stringcolumn(4),$3)):5 with labels tc pal

My input file looks roughly as follows:

49.396155 6.695042 15583 "Beckingen"   206
49.354931 7.263340 18457 "Bexbach"     249
49.237624 7.245526 22422 "Blieskastel" 218
49.263738 6.783259  7290 "Bous (Saar)" 229
...

Locations needed to be converted into ISO 8859-1 back when I did this, since Gnuplot did a poor job at UTF-8. This has probably been fixed since.