Category: Maps

  • How to make a UK constituency map from a spreadsheet

    How to make a UK constituency map from a spreadsheet

    To make a map of UK parliamentary constituencies, you need a spreadsheet with one column of constituency names (or ONS codes such as E14001063) and one column of values. Paste it into the JFDI map maker and you get a map of all 650 Westminster seats, drawn on the July 2024 boundaries, without signing up or uploading anything.

    This guide walks through it with real data, then covers the problems that trip most people up: old boundaries, spelling differences and party colours.

    What you need

    A table with two columns is enough (these values are made up):

    ConstituencyValue
    Aberafan Maesteg41.2
    Aberdeen North38.7
    Aberdeen South44.0

    The first row should be a header. The values can be numbers (turnout, majority, population, a survey score) or words (the winning party, Leave or Remain). Words make a map of categories, each with its own colour.

    You don’t need to tidy the names first. The map maker recognises constituencies by name however they’re written, and by their nine-character ONS code. If your file has both, that’s fine too.

    Step by step

    1. Open the map maker and paste your cells into the box (copy them straight from Excel or Google Sheets), or drop a CSV or Excel file onto the page.
    2. Check the match count. The Data section says which map it chose and how many rows matched. For constituency data, it picks Constituencies as hexagons (2024) by default.
    3. Fix anything unmatched. Press Fix to see rows it couldn’t place. Typos come with a suggestion you can accept in one click.
    4. Choose colours and a title. Under Colours, pick a light-to-dark set for numbers, or keep the automatic colours for categories.
    5. Download it as PNG, SVG or PDF, or copy the embed code for a web page.
    A hexagon map of all 650 UK constituencies, shaded by population
    Every constituency gets one hexagon. This one shows each seat’s population, from ONS small-area estimates.

    Hexagons or real shapes?

    You get hexagons by default because they’re fairer for constituency data. Constituencies have roughly equal numbers of voters, but very unequal areas. Caithness, Sutherland and Easter Ross covers about 11,600 km², more than seven times the area of all 75 London seats put together (about 1,570 km²). On a normal map, the big rural seats dominate and you can barely see the cities.

    On the hexagon map, which uses the House of Commons Library’s layout, every seat is the same size. Switch to real boundaries under Data › Map › Constituencies (2024) if you want geography instead. There’s more on this choice in Hex maps vs real maps: why election maps use hexagons.

    Election results get party colours

    If your values are party names (Labour, Conservative, Liberal Democrat, SNP, Plaid Cymru, Reform UK, Green and so on), the map uses each party’s usual colour, as election maps on TV do. You can switch to any other colour set under Colours.

    Common problems

    “Some of my constituencies don’t match”

    The most common cause is old boundaries. Constituency boundaries changed at the July 2024 general election, and data from before then (including the 2019 results) uses the old seats. The map maker recognises the old ONS codes and tells you they’re from the previous boundaries, rather than quietly putting them in the wrong place.

    Many names didn’t change in 2024, so a file can match almost perfectly and still be on old boundaries. Check the date of your data before you publish.

    “It picked the wrong map”

    If your table mixes levels (some councils, some constituencies), the map maker picks the level with the most matches. Choose the map yourself under Data › Map.

    Totals and rates

    If you’re mapping a count, such as the number of people claiming a benefit, compare like with like. Constituencies have similar electorates but not identical populations, so a rate (per 1,000 people, or a percentage) is usually fairer than a raw count. The map maker spots columns that look like totals and suggests a rate. Our explainer on what a choropleth map is and when it misleads goes into why.

    Where the boundaries come from

    The 2024 constituency boundaries are the Office for National Statistics’ generalised boundary files, published under the Open Government Licence, and the hexagon layout is the House of Commons Library’s, under the Open Parliament Licence. The map carries the required credit at the bottom; keep it if you crop the image. You can use the maps commercially.

    Is my data private?

    Yes. The map is drawn inside your browser, and the spreadsheet never leaves your device. That matters if you’re mapping unpublished polling, membership lists or canvassing returns. If you make a share link, the data travels inside the link itself, so treat the link like the data.

    Related

  • Map of the month: equal electorates, very unequal populations

    Map of the month: equal electorates, very unequal populations

    Westminster constituencies were drawn to have nearly equal numbers of voters, but the number of people living in them varies almost twofold. Leaving aside five protected island seats, the smallest constituency by population, Congleton, has about 84,000 residents; the largest, Cities of London and Westminster, has about 163,000. Thirty-one of the fifty most populous seats are in London.

    A hexagon map of UK constituencies shaded by population, with the darkest hexagons concentrated in London and major cities
    Population of each Westminster constituency (2024 boundaries). One hexagon per seat. Source: ONS small-area population estimates (mid-2019), via mySociety.

    The rule: equal electorates

    For the 2023 boundary review, which set the seats used at the July 2024 general election, each constituency had to have between 69,724 and 77,062 registered electors, within 5% of a quota of 73,393, based on the electoral register of 2 March 2020. Five island seats were protected from the rule: the two Isle of Wight seats, Na h-Eileanan an Iar, Orkney and Shetland, and Ynys Môn (2023 review).

    So every MP outside the islands represents roughly the same number of voters. They don’t represent the same number of people.

    The numbers

    Across the 645 seats subject to the rule:

    Population
    Smallest (Congleton)83,907
    10th percentile92,181
    Median100,479
    90th percentile117,075
    Largest (Cities of London and Westminster)162,641

    The ten most populous seats are:

    ConstituencyPopulation
    Cities of London and Westminster162,641
    Birmingham Ladywood157,574
    Kensington and Bayswater147,231
    Hampstead and Highgate144,676
    Poplar and Limehouse141,599
    Erith and Thamesmead139,649
    Tottenham138,358
    Holborn and St Pancras137,909
    Bethnal Green and Stepney135,919
    Coventry South135,355

    And by region, the average London seat has about 119,000 residents, against about 96,000 in Scotland and 97,000 in the South West.

    Why the gap?

    Equal electorates and unequal populations aren’t a contradiction: lots of residents aren’t on the electoral register. The seats with the most people per voter tend to share features that are likely to explain much of it:

    • Children. Under-18s can’t vote in general elections, so seats with more young families have more residents per elector.
    • People who can’t vote in general elections. Most foreign nationals, including most EU citizens, can’t, while Irish and qualifying Commonwealth citizens can. Seats with many residents from elsewhere have fewer electors per head.
    • People who aren’t registered. Registration rates are lower among renters, people who move often and students, all common in inner cities.
    • Timing. The populations here are mid-2019 estimates and the electorates come from March 2020; places growing fast have moved on since.

    This data can’t separate these effects, so treat them as likely contributors rather than a measured breakdown.

    What it means

    Equal electorates are the legal standard, and there are good arguments for it: MPs are elected by voters. But MPs also serve residents who can’t vote, taking up their casework and representing them in Parliament. An MP for Birmingham Ladywood represents nearly twice as many people as one for Congleton.

    How this map was made

    The population figures are the ONS’s mid-2019 small-area estimates, added up for each 2024 constituency by mySociety, and they’re built into the JFDI map maker: it’s the UK constituencies example on the start page. The map uses the House of Commons Library’s hexagon layout, so every seat is the same size. On a normal map, London’s 75 seats would cover less than 1% of the picture; see why election maps use hexagons.

    Open the example, change the colours, switch to real boundaries or add your own data, and download it. Every map you make is yours to use, with the boundary credit kept at the bottom.

    Map of the month takes a public dataset each month and maps it. Suggestions are welcome.

    Related

  • Hex maps vs real maps: why election maps use hexagons

    Hex maps vs real maps: why election maps use hexagons

    Election maps use hexagons because constituencies have roughly equal numbers of voters but wildly unequal areas. On a normal map, a handful of huge rural seats fill most of the picture and the cities shrink to specks. A hex map gives every seat one identical hexagon, so the picture shows seats, which is what decides an election.

    The numbers behind the distortion

    I added up the areas of all 650 Westminster constituencies on the July 2024 boundaries (ONS boundary files):

    AreaSeatsShare of seatsShare of UK land
    London7511.5%0.6%
    Scotland578.8%32%
    Rest of the UK51879.7%67%

    London elects more MPs than Scotland, yet on a normal map Scotland takes up about fifty times as much space. Fifty-nine seats are smaller than 20 km², while the largest, Caithness, Sutherland and Easter Ross, covers about 11,600 km². Colour each seat by the winning party and the map mostly shows who won the Highlands.

    The same constituency data drawn as real boundaries and as hexagons
    The same data both ways. On the left, real boundaries; on the right, one hexagon per seat.

    What a hex map is

    A hex map is a kind of cartogram: a map where the size of each area stands for something other than land. Here, each constituency is one hexagon, placed roughly where it really is so neighbours stay neighbours. London becomes a recognisable cluster, and you can see every seat in Manchester or Glasgow.

    The layout used in the JFDI map maker is the House of Commons Library’s, the same one many newsrooms use. It’s published under the Open Parliament Licence.

    When to use hexagons

    Use a hex map when each area counts equally in what you’re showing:

    • election results and vote shares
    • polling or MRP estimates by seat
    • anything per constituency that an MP or campaign will act on, such as casework or survey responses

    Use real boundaries when geography matters:

    • something physical, such as flood risk, broadband coverage or distance to a hospital
    • when readers need to find a specific place by shape or coastline
    • local data within one region, where size differences are smaller

    The trade-offs

    Hex maps aren’t free of distortion; they move it somewhere else.

    • Shapes and positions are approximate. A seat may sit a hexagon away from where you expect. Labels or a hover tooltip help people find their own.
    • Population isn’t exactly equal. Seats were drawn to have electorates within 5% of 73,393 (with five protected island seats excluded), but total population, including children and people not registered, varies much more.
    • Readers need a moment. Add a subtitle such as “One hexagon per constituency” so nobody mistakes it for geography.

    Councils: a different kind of cartogram

    Local authorities vary in population as well as area, from the Isles of Scilly to Birmingham, so one hexagon each would be unfair the other way. For councils, the map maker offers Local authorities sized by population, also from the House of Commons Library, where each council is built from small hexagons of about 8,000 people. Big cities get room in proportion to their residents.

    How to switch

    In the map maker, load your constituency data, then open Data › Map and choose between Constituencies (2024) and Constituencies as hexagons (2024). Your colours, title and data carry over, so you can download both and compare them. The step-by-step guide covers getting your data in.

    Sources

    • Constituency areas: ONS Westminster Parliamentary Constituencies (July 2024) boundaries, Open Government Licence.
    • Electoral quota: 2023 review of Westminster constituencies.
    • Hexagon layout: House of Commons Library, Open Parliament Licence.
  • What is a choropleth map, and when does it mislead?

    What is a choropleth map, and when does it mislead?

    A choropleth map shades each area, such as a country, state or council, according to a value, with darker colours usually meaning more. It’s the most common kind of data map. It works well for rates (per person, per km², percentages) and badly for totals, because big areas look important just for being big.

    Where the name comes from

    The word comes from the Greek choros (area) and plethos (multitude). The geographer John Kirtland Wright coined it in 1938, but the idea is much older: Baron Pierre Charles Dupin drew a map of France in 1826 shading each département by access to basic education, usually counted as the first choropleth (Wikipedia).

    Mistake 1: mapping totals

    Shade a world map by total population and China and India are darkest, which is true but tells you nothing a list wouldn’t. Shade it by people per km² and you see where people are actually crowded: Bangladesh, the Netherlands, Singapore, Rwanda.

    The same population data as a total and as a rate
    Left: total population, which mostly shows which countries are big. Right: people per km², which shows where people are crowded.

    Totals are what statisticians call extensive variables: they grow with the size of the area. Rates are intensive: they don’t. A choropleth should almost always show a rate. Skipping this step is one of the most common mistakes in data maps; it made some COVID-19 dashboards misleading.

    If what you really want to show is a total, use sized dots instead: one circle per area, its size set by the value. Readers judge a total by the size of a circle much better than by a shade of colour.

    The JFDI map maker checks for this. If a column looks like a total (it rises and falls with population, or it’s called something like Total, Number or Deaths), it suggests showing it per million people, per km², or as sized dots. You can still keep it as it is.

    Mistake 2: big areas shout

    Even with a rate, every area is filled with one flat colour, so a large area looks like it carries more weight than a small one with the same value. Russia, Canada and the US Mountain West dominate maps because they’re big. Ten cities with high values can be invisible next to one empty county with a slightly lower one.

    Ways to soften this:

    • Equal-area projections. The Mercator projection used by web maps makes Greenland look as big as Africa, when Africa is about 14 times larger. Use an equal-area projection, such as Equal Earth, for any shaded map. The map maker warns you if you pick Mercator for one.
    • Tile or hexagon maps, where every area gets the same space. These suit US states and UK constituencies. See why election maps use hexagons.
    • A cartogram, where each area is sized by population.
    • Small areas drawn as dots so places like Singapore or Malta don’t disappear.

    Choosing the colour steps

    How you split values into colours changes the story. The same data can look calm or alarming depending on where the breaks fall.

    MethodUse it when
    Equal numbers of places per colour (quantiles)Most data. Uses the full colour range.
    Natural breaksValues fall into clear clusters.
    Equal-sized stepsValues are spread evenly, or round numbers matter.
    Your own thresholdsA number means something, such as 50% or a target.
    Smooth gradientYou want every difference visible. Add a log scale for data spanning several orders of magnitude.

    Use one light-to-dark colour ramp for values that run from low to high. Use a two-sided (diverging) ramp only when there’s a meaningful middle, such as zero change or the national average.

    A quick checklist

    Before you publish a shaded map, check that:

    1. It shows a rate, not a total (or uses sized dots for totals).
    2. It uses an equal-area projection.
    3. The colour steps are explained in the legend, and the breaks aren’t hiding the story.
    4. Areas with no data are a neutral grey, not the lightest colour.
    5. The title says what’s being measured and the source line says where it came from.

    Related

  • How to map US county data from Excel (FIPS codes explained)

    How to map US county data from Excel (FIPS codes explained)

    To map US county data, you need a column that identifies each county, ideally its five-digit FIPS code, and a column of values. Paste both into the JFDI map maker and it draws all of the roughly 3,200 counties and county-equivalents, with state borders on top. It’s free, there’s no account, and your spreadsheet isn’t uploaded.

    Most problems with county maps come from the codes, not the map. Here’s how FIPS codes work and how to avoid the usual gaps.

    What a FIPS code is

    A county FIPS code has five digits: two for the state, then three for the county within it.

    CountyState codeCounty codeFIPS
    Autauga County, Alabama0100101001
    Los Angeles County, California0603706037
    Cook County, Illinois1703117031
    Miami-Dade County, Florida1208612086

    Almost every US government dataset (Census Bureau, BLS, CDC, USDA) includes FIPS codes, often in a column called GEOID, FIPS or county_fips. Codes are more reliable than names, because many states share county names: there are dozens of Washington Counties and Jefferson Counties.

    Step by step

    1. Get your data into two columns: the FIPS code (or county name) and the value. Extra columns are fine.
    2. Paste it into the map maker, or drop the CSV or Excel file on the page. It recognises county data and switches to the US county map on its own.
    3. Check the match count under Data. If any rows aren’t matched, press Fix to see why.
    4. Pick a scale. With 3,000 areas, a smooth gradient often reads better than steps. Turn on Log scale for things like population density that vary a thousandfold.
    5. Zoom if you need to. If all your data is in one state or a few neighbouring ones, the map zooms in automatically. You can choose the area yourself under Map › Area.
    A map of US counties shaded by population density
    US counties by people per square kilometre, on a log scale. Census Bureau 2019 estimates.

    Mistake 1: Excel drops the leading zero

    Open a CSV in Excel and 01001 becomes 1001. Every county in the seven states whose codes start with 0 (Alabama, Alaska, Arizona, Arkansas, California, Colorado and Connecticut) loses a digit. Joins in other tools then quietly fail for those states.

    The map maker handles four-digit codes, so 1001 still finds Autauga County. If you need the zeros back for other work, the JFDI file converter keeps them when it turns a CSV into an Excel file. There’s a whole post on why Excel loses leading zeros and how to stop it.

    Mistake 2: Connecticut’s counties no longer exist in the data

    Connecticut replaced its eight counties with nine planning regions as county-equivalents. The Census Bureau began publishing data for the regions in 2023, starting with population estimates and the 2022 American Community Survey (CTData). The new codes run from 09110 to 09190:

    FIPSPlanning region
    09110Capitol
    09120Greater Bridgeport
    09130Lower Connecticut River Valley
    09140Naugatuck Valley
    09150Northeastern Connecticut
    09160Northwest Hills
    09170South Central Connecticut
    09180Southeastern Connecticut
    09190Western Connecticut

    The region boundaries don’t line up with the old counties, so there’s no honest way to draw old-county data (such as Fairfield County, 09001) on the current map. The map maker tells you this rather than guessing. If your data is older, you’ll need a pre-2022 boundary file, which you can load under Map › Use my own boundaries.

    Mistake 3: Names that changed

    A few counties have been renamed or split, and older datasets still use the old versions:

    • Shannon County, South Dakota became Oglala Lakota County in 2015, with a new code. The map maker matches both.
    • Dade County, Florida is Miami-Dade.
    • Valdez-Cordova, Alaska split into Chugach and Copper River in 2019. The map shows the combined area, and data for the two new areas is suggested as part of it.

    If you only have names

    Names work, as long as the state is there too. All of these match:

    • Cook County, Illinois, Cook County, IL, Cook, IL
    • county in one column and state in another (the map maker pairs them up)
    • parishes in Louisiana, boroughs and census areas in Alaska, and Virginia’s independent cities (Fairfax city and Fairfax County are different places)

    A county name with no state only matches if just one county has that name.

    Where to get county data

    • data.census.gov for the American Community Survey (income, housing, commuting and much more)
    • the Bureau of Labor Statistics’ Local Area Unemployment Statistics for monthly unemployment rates
    • CDC WONDER for health data

    Map rates (per person, per cent, per square mile) rather than totals: big counties otherwise look important just for being big. What is a choropleth map, and when does it mislead? explains why.

    Related