Convert regional counts to stable synthetic dots without implying exact locations, and audit rounding, area, projection and rendering limits.
Dot-density maps: fixed dot value, reproducible placement and area meaning
State what one dot represents
A dot-density map places repeated symbols inside a geographic area to express an aggregate count. If one dot represents 47 households, a region with 470 households receives ten dots. Those coordinates are a visual allocation inside the region, not the known addresses of the households. This distinction belongs in the title or legend, because a reader may otherwise infer a cluster at a fabricated location. Use a fixed dot value across compared regions and state the rounding rule for counts that are not exact multiples. A region with zero reported count needs a different treatment from one with missing data; drawing neither would conflate absence with ignorance. Choropleth missingness and proportional symbols offer related but different spatial encodings.
Choose the allocation unit and map projection
Dots dispersed uniformly inside a coarse district depict its district-level total but provide no evidence of neighborhood-level distribution. If a finer geographic breakdown exists, allocate within those smaller units first; do not use a population-weighted placement mask unless that secondary data is reliable, documented and appropriate to the measured phenomenon. Map area matters. On an equal-area projection, a region covering twice the physical area can display the same number of dots at half the visual density. A projection that changes relative area across the map can create a false density comparison. Longitude and latitude degrees are not equal-area drawing units, so do not sample uniformly in raw degrees and treat the result as an area-faithful map. The small contract below accepts rectangular regions already expressed in equal-area planar coordinates. A real irregular polygon needs a proper geometry sampler and masking around holes or excluded land. Projection and wrapping must be resolved before placement.
Make random placement stable and disclose rounding
If dots jump to new positions after every refresh, a reader can mistake random redraw for a changed population. Use a fixed seed tied to a chart revision, and preserve that seed in export metadata. Independent seeds across regions keep one region's appearance stable when another region is added. The count-to-dot conversion here rounds each region to the nearest whole dot, with exact half-dot ties rounded upward for nonnegative counts. This introduces at most half a dot value of absolute rounding error per region. Show original counts in a table and keep an aggregate reconciliation of rendered-equivalent count versus source count. Choosing a very large dot value can erase small regions; choosing a tiny value can flood the display and slow rendering. Set a practical visible-dot budget before drawing. Export manifests capture the dot value and seed, while level-of-detail controls cover dense outputs.
Limit what a viewer can infer
A dot map can help compare the spatial density of counts when the areas, units and projection are compatible. It cannot locate an individual observation, prove a cluster inside a region, or explain why a count is high. Dot overlap at small view scales can make density look darker without revealing individual marks; zoom behavior needs a declared reference scale or a separate small-scale rendering policy. For several categories, maintain the same dot value and distinguish categories by labels and accessible symbols or colors, then reconcile each category's count independently. If totals are the decision metric, a table or proportional symbol map may be easier to read. If rates are the decision metric, a choropleth with a meaningful denominator may be better. Do not mix a count-encoded dot map with a rate legend. Denominator discipline and accessible text keep the map's claim precise.
Worked contract
from hashlib import sha256
from math import isfinite, floor
from random import Random
def dot_density_rectangles(regions: list[tuple[str, int, tuple[float, float, float, float]]],
dot_value: int, revision: str, max_dots: int = 20000):
if (not isinstance(dot_value, int) or dot_value <= 0 or
not revision or not isinstance(max_dots, int) or max_dots <= 0):
raise ValueError("dot value, revision and budget must be valid")
seen = set()
output = []
rendered_total = source_total = 0
for region_id, household_count, bounds in regions:
if (not region_id or region_id in seen or
not isinstance(household_count, int) or household_count < 0 or
len(bounds) != 4 or any(not isfinite(edge) for edge in bounds)):
raise ValueError("region IDs, counts and planar bounds must be valid")
seen.add(region_id)
west, south, east, north = bounds
if not west < east or not south < north:
raise ValueError("rectangles need positive area")
dot_count = floor(household_count / dot_value + 0.5)
if rendered_total // dot_value + dot_count > max_dots:
raise ValueError("visible dot budget exceeded; increase dot value")
seed_bytes = sha256((revision + ":" + region_id).encode()).digest()
randomizer = Random(int.from_bytes(seed_bytes[:8], "big"))
dots = [(randomizer.uniform(west, east), randomizer.uniform(south, north))
for _ in range(dot_count)]
output.append((region_id, household_count, dots))
source_total += household_count
rendered_total += dot_count * dot_value
return output, source_total, rendered_total
districts = [("district-47", 470, (0.0, 0.0, 4.0, 2.0)),
("district-59", 117, (4.0, 0.0, 6.0, 2.0))]
placements, source, represented = dot_density_rectangles(districts, 47, "release-83")
assert [len(row[2]) for row in placements] == [10, 2]
assert (source, represented) == (587, 564)
assert placements == dot_density_rectangles(districts, 47, "release-83")[0]
assert all(0 <= x <= 4 and 0 <= y <= 2 for x, y in placements[0][2])Performance and operating cost
For R regions and D emitted dots, region validation and count conversion take O(R) time, placement O(D) time, and the returned coordinates O(D) space. The per-region seed hash has constant input handling apart from identifier length. The worked first rectangle holds ten dots for 470 households; the second holds two dots for 117 households. Those twelve dots represent 564 households against a source total of 587, a 23-household rounding gap shown explicitly rather than hidden. This is a rectangle-only placement contract in equal-area planar coordinates. For real polygons, use a geometry library with interior and hole checks; no synthetic point should escape its region.
Common Mistakes
- Presenting a synthetic dot as an actual household or event location.
- Sampling uniformly in raw longitude and latitude while interpreting dot spacing as equal area.
- Changing the random seed on refresh and implying moved observations.
- Leaving a low-count region visually blank without showing its original count and rounding loss.
Validation drill
Map 47 synthetic districts with one dot per 47 households. Audit original count, displayed dot count and rounding error by district; hold the seed and projection fixed across two releases, and reject a scale that exceeds the visible-dot budget.
