PlotSet LogoPlotSet

How to Create a Choropleth Map

A step by step walkthrough for turning a spreadsheet of place names and numbers into a published choropleth map in PlotSet, from matching region names to exporting or embedding the finished map.

约 8 分钟

Place names and numbers go in; how to create a choropleth map in PlotSet comes out the other side as a published, interactive map you can share or embed. You will end up with regions shaded by your own values, a color scale that actually fits the data, and a legend that tells the reader what the shading means: not a screenshot of somebody else's country list with your numbers dropped in.

If your spreadsheet already uses the exact place names PlotSet's map template recognizes, this takes about eight minutes. Add another ten if you are starting from a report full of abbreviations, ISO codes or older country names: matching those to the template's region list is the part that eats time, not the styling. Budget the eight minutes below and treat the rest as a buffer.

你需要的数据

One row per region, two columns: the place name first, matching how the template labels its regions, and the number second. One header row, no totals row.

示例 CSV
CountryCO2 per Capita (tonnes)
United States14.2
Germany8.1
China7.6
Brazil2.2
India1.9
Nigeria0.6
备注

Use the same place names the map template uses, not abbreviations or codes. "USA" or "US" often will not match a region labeled "United States", and a mismatch drops that row's shading instead of throwing an error.

One number per region. If you want two years side by side, that calls for two separate maps or a time slider, not two columns crammed into one choropleth.

Leave regions you have no data for out of the sheet entirely, rather than filling them with a zero. PlotSet gives any region with no matching row a distinct no-data color; a zero would shade it like a real low value instead.

Delete any totals or world-aggregate row before uploading. A "Global" or "World" row has no matching region on the map, so it gets ignored, but it is cleaner to remove it at the source than to rely on that.

操作步骤

PlotSet 中从空白模板到完成图表的具体点击路径。

  1. 01

    Open the Choropleth Map template

    From the PlotSet dashboard, start a new project and choose the Choropleth Map template. It loads with a world map and sample data already in place, so you can see the place-name and value columns the template expects before swapping in your own file.

    PlotSet 的模板选择界面:左侧是图表分类列表,中间展开 Bar Charts 分类的模板网格,Bar Chart 模板卡片上显示「Select」按钮。
    每份指南都从这里开始:先选分类,再选模板,不管你要做哪种图表,用的都是同一个网格。
  2. 02

    Pick the map that matches your data's geography

    Choose world countries, or one of the state, province and county maps in the template library if your rows sit below the country level. Settling this first avoids a second round of place-name matching once you realize the template you started with is the wrong scale.

  3. 03

    Shape your sheet into a place column and a value column

    Put the region name in the first column and its number in the second, one row per region. Use standard names rather than abbreviations, ISO codes or postal codes: whatever format the map template's region list expects.

  4. 04

    Upload the file, or connect a sheet

    Use the data panel to import a CSV or .xlsx file, paste rows directly from a spreadsheet, or connect a Google Sheet so the map can pick up updated figures later without a re-upload.

    PlotSet 编辑器的数据视图:表格中 Name、Value、Region 三列填着加拿大各省的数据,旁边的「Data」面板提供 CSV 上传、「Magic Import」和 Google Sheet 同步。
    这里的数据视图取自一个条形图项目。你可以上传 CSV、用「Magic Import」从图片里提取数字,或同步 Google Sheet,每种图表类型的面板都一样。
  5. 05

    Check the unmatched-region list

    After upload, confirm which column PlotSet read as the place name and which as the value. Then look at the unmatched list it shows: any row whose name did not find a region on the map lands there, and it is almost always a spelling or naming difference you can fix in seconds.

    PlotSet 数据面板中高亮的列绑定:「Label/time」对应 A 列,「Values」对应 B 列,「Filter/color」对应 C 列,下方是「Auto Binding」按钮。
    绑定决定哪一列作标签、哪一列提供数值、哪一列决定颜色。「Auto Binding」(自动绑定)会根据表头推测,所以要核对一遍,别想当然。
  6. 06

    Choose a color scale and set the no-data color

    Use a single-hue sequential scale, light to dark, for ordinary low-to-high figures, and switch to a diverging scale only when your numbers have a real midpoint, such as zero or a national average. Set a distinct gray for regions with no matching data so missing never reads as low.

    PlotSet 编辑器停在「Preview」标签页:画布上是做好的 Choropleth Map,右侧的设置面板用红框标出。
    Choropleth Map 的「Preview」标签页。所有样式设置都在红框标出的这个面板里,每个设置各自占一个标签页:外观、标题、脚注,以及这种图表类型特有的选项。
  7. 07

    Add a legend and a title that names the measure

    Turn on the legend so the shading has a key, and title the map with what is being measured, "CO2 emissions per capita" rather than just "Map". A reader should know what the color means before they hover over a single region.

  8. 08

    Publish, embed or export the map

    Publish for a live, interactive map with hover tooltips and a shareable link, grab the embed code to drop it into a page, or export a PNG, SVG or PDF if you need a static image for a deck or a report.

从已加载示例数据的 Choropleth Map 模板开始,再替换成你自己的数据。

打开模板

发布、嵌入或导出

最后一段路对每种图表都一样:「Share」(分享)把图表变成一个在线的公开链接和一段嵌入代码,「Export」(导出)把它输出成静态文件。

Share:公开链接与嵌入代码

打开嵌入代码和公开链接的开关,图表就发布出去了。链接可以放心发给任何人;嵌入代码以 iframe 的形式放进任意页面,悬停提示和交互效果都会保留。之后修改了图表,点「Recreate」就能把改动同步到链接和嵌入代码两边。

PlotSet 编辑器工具栏中高亮的「Share」按钮,紧挨着「Export」按钮。
点「Share」,完成的图表就会变成一个公开链接和一段嵌入代码。
PlotSet 的「Share」对话框:用于启用嵌入代码和公开链接的开关,「Link」「Embed」「Facebook」「Reddit」「Twitter」「LinkedIn」「Email」几个按钮,以及带「Copy」按钮的图表公开链接。
打开嵌入代码和公开链接的开关,然后复制链接或取用 iframe。之后再修改图表,点「Recreate」就能把改动同步给所有已拿到链接的人。

Export:SVG、PNG 或 JPG

「Export」会按你需要的尺寸输出一份静态副本。SVG 放到多大都清晰,还能在设计工具里继续编辑;幻灯片和文档用 PNG 或 JPG 最稳妥。想让图片在高分屏上够锐利,关键就是那个倍数设置。

PlotSet 编辑器工具栏中高亮的「Export」按钮。
要做成幻灯片或报告里的静态文件,就走「Export」这条路。
PlotSet 的「Export chart」对话框:倍数选择器设为 2x,宽高输入框填的是 1000 和 600,展开的格式菜单里列出 SVG、PNG 和 JPG。
SVG 放到多大都清晰,还能在设计工具里继续编辑;做幻灯片用 PNG 或 JPG 最稳妥。导出前先设好倍数,图片在高分屏上才够锐利。

Choropleth Map 的样式提示

Match names to the template, not to each other

PlotSet's map templates use a fixed list of region names per geography. Before uploading, check your trickier entries (small countries, disputed territories, recently renamed regions) against the template's own list rather than assuming your source spreadsheet's spelling counts as standard.

Shade rates, not raw counts

Land area does not track population, so a map colored by total count usually just redraws where people live. Convert to a rate, share or per-capita figure before shading, and save the raw totals for a bar chart instead.

Keep one level of geography per map

A single choropleth should shade one scale at a time: country, or state, not both mixed together. If you need a national overview and state-level detail, build two maps rather than combining region sizes on one, which breaks the color scale's comparison.

Label the no-data color in the legend

A gray swatch with no explanation leaves the reader guessing whether it means zero or unknown. Label it "No data" directly in the legend so the distinction is stated, not inferred from context.

制作 Choropleth Map 时的常见错误

Regions are missing shading even though they're in your sheet

This is almost always a name mismatch: your sheet says "USA" or "Ivory Coast" while the map template expects "United States" or "Côte d'Ivoire". Open the unmatched-rows list PlotSet shows after upload and correct the spelling for each name it flags, then re-upload.

The map looks like a population map, not your actual metric

Check whether you uploaded a raw count instead of a rate. Totals shade almost any map the same way a population map would, since bigger, denser regions post bigger numbers regardless of what you meant to measure. Divide by population or another sensible denominator and re-upload.

Missing regions look identical to low values

If every unshaded region sits at the same pale end of the scale as your lowest real values, the no-data color was probably never set. Open the color settings, assign a distinct gray to no-data, and leave regions you have no figure for out of the sheet entirely.

深入了解 Choropleth Map

不确定 Choropleth Map 是否是正确选择?查看它是什么、何时使用以及何时不使用。

关于 Choropleth Map

Choropleth Map:常见问题

One column of place names and one column of numbers, with one row per region and one header row. The place names need to match the names the map template uses, standard country or state names rather than abbreviations or ISO codes, or that row's region will not get shaded.

现在制作你的 Choropleth Map

免费开始,300+ 模板任选。无需信用卡。