# How to represent bimodal attribute value distributions on a map

I'm looking for a visualisation method that enables me to represent bimodal or even multimodal attribute value distributions on line features.

A bimodal distribution has two different modes that appear as distinct peaks in the probability density function (image #1). Mean, median and standard deviation values are of little use to describe such data.

#1 Example of a bimodal distribution:

(source: wikimedia.org)

My use case is the following: For all road links in a network, I have associated speed measurements (many hundreds per link) in bimodal - sometimes multimodal (three modes) - distributions. Now, I'm looking for a way to visualize this data on a map.

Besides attaching a bar diagram to each link, I haven't found any way to achieve my goal using a GIS. The visualisation results should be printable so animations won't do.

#2 Example visualisation using diagrams:

All ideas welcome!

• Are you using "modal" in context of transportation planning or in statistics? One's choice in mode of transportation is a nominal scale (car, bus or rail) whereas one's body length is ratio scale. en.wikipedia.org/wiki/Level_of_measurement Commented Aug 2, 2010 at 21:02
• Modal as in statistics, sorry I thought it would be clear with the image and description of "bimodal distribution". Commented Aug 2, 2010 at 21:34

One way you might handle this is to bin your distribution data into speed classes, and calculate the percentage of each segment within each class. Then, you could create parallel line segments and scale their width based on the percentage to produce something like this:

This could be accomplished in GRASS for instance by using `v.parallel` (manual page), which can create parallel lines on either side of a segment at a set distance.

Similarly, you could create one line segment per line-speed measurement pairing, with small levels of drift added to the coordinates. Then, color the segments using speed as the attribute. This could also be clarified by using transparency, depending on the requirements of the output, producing something like:

Finally, a hybridized approach would be to use a single color gradient across all line segments, and then use the alpha channel of a segment as a compressed representation of the distribution. By combining those elements, you'll end up with a dataset which uses color to represent speed, and the strength of transparency to represent the prevalence of the value within the segment:

• I think the first idea is brilliant, but I'm having a tough time visualizing the second turning out as anything but grey goop. Do you know of an example? Commented Aug 2, 2010 at 21:51
• I like the idea, but the problem I see in approach 1 is that information about modes is not used. As the bins would have to be same for all segments, in some cases that would lead to bad splits (e.g. splitting one peak). Approach 2 sounds even more promising. It would require some pre-processing and normalization to work with huge datasets of course. Does any OS GIS support multi stroke-line styling like shown in the picture? Commented Aug 3, 2010 at 0:47
• The transparency lets you see the actual density of lines - more lines make for more opaque color. Basically, it just prevents the mass of green lines from turning the whole segment into a solid green bar. It's a little weird in this application because the overlap of the lines is caused by random jittering, rather than actual overplotting (compare with this scatterplot:had.co.nz/stat405/resources/drills/plot-drills/ggplots/…). Commented Aug 3, 2010 at 15:24
• @underdark: A couple of options for the multi-stroke: buffer the lines at different values to create the widths, then color each polygon separately. Alternatively, you could write a little python in QGIS with the new symbolizer (qgis.org/wiki/Symbology-NG). You needn't be limited to only 3 segments, you could make however many bins you'd like with either of these methods.
– scw
Commented Aug 4, 2010 at 19:03
• I've included a link to v.parallel in my response, which should provide a nice way of computing the first solution: create parallel line segments at distances equal to the quantities, then adjust their thickness with symbolization tools such as those in QGIS.
– scw
Commented Aug 13, 2010 at 23:47

Perhaps use a set of adjoining fixed-width parallel lines. Each line could be drawn to reflect the magnitude of its corresponding bin (consider grayscale: dark would be high frequency, light would be small). The result would appear somewhat like the alpha channel of scw's answer. In effect, you smear the histogram/density along an areal line segment. The overall cartographic workflow would be somewhat cumbersome (due to manually or coding the linear offset -- not to mention intersection handling), but it would be implementable within standard GIS. Regardless of the technique you use or devise, if it makes an elegant map, please do share your findings. Good luck!

(comments below may be useful for those trying this idea)

• I tried you suggestion yesterday. The problem I encountered with your grayscale solution (it would be great for printing) is that it's hard to interpret because the result is dependent on the orientation of the line. Meaning: Sometimes high speeds are on the left, sometimes on the right side of the line. Would have to introduce additional arrows maybe, but then it gets really full. Commented Aug 4, 2010 at 11:26
• Thanks for the comment. You are right. Directionality is a problem. An additional visual cue could be created (like an arrow or a thin line bordering the "fast lane"). In the end, though, and upon further reflection, I think the graded path technique probably should be applied only to the narrow use case when the network all follows the same general direction. Hope such discussion helps others. Commented Aug 4, 2010 at 17:44

Why not use the grayscale solution from glennon, but have it mirrored so that you have high velocity on both sides of the line. Then the apparent thickness of the line will tell you the average speed, and the stripes will tell you if there's more than one mode.

The image below shows what the sample from the question would look like with mirrored lines. I used black lines with opacity on the left image, and color-coded lines with opacity on the right.

I added some gamma (2) to the opacity so that the peaks stand out more.

Mirrored fixed-width grayscale and color lines http://img23.imageshack.us/img23/4920/mirrored.png

• The width of the line wouldn't change. Glennon suggested fixed-width lines. Mirroring the lines would double the width of already very wide lines and thus making it impossible to visualize bigger network extents. Also, I think this would be really hard to interpret. Commented Aug 5, 2010 at 10:57
• +1 Thanks for the additional images. For different data, this approach might work. As image #2 in my question indicates, I'd like to work with approx. 10 bins or - if possible - avoid "binning" the data all together. Commented Aug 11, 2010 at 16:19
• My images actually use the distributions from image #2 in your question. Just to clarify your problem - if you had to decide (e.g. in a big network, where it'd be impossible to show all the information) to reduce the distribution to a single variable, would you prefer the number of peaks, the average speed, peak speed (i.e. the one with the highest peak), or something else? Commented Aug 11, 2010 at 19:48
• My favorite solution would be number of peaks, speed of those peaks and maybe some information on the width of the peak. If I'd have to chose only one variable, I'd most likely go for peak speed ... Average speed is what I have now, but I want to change away from it. Commented Aug 12, 2010 at 21:27

Silverlight (and probably flex) support animated line symbols. You could make dashed lines where the dashes move along the line based on speed, and width represents traffic volume. I've never seen any cartographic standards suggested for animated symbols, but perhaps there are some.

• Actually, I don't see how that makes it possible to visualize a bimodal distribution of speed measurements. Parallel lines, one per peak in the distribution ... sounds messy. Commented Aug 3, 2010 at 21:43