
Show Attribute Values on a Map with Labels
What you'll learn
- How to show labels for vector data
- How to customize label display
Recommended for
- Anyone who wants to add labels to vector data in QGIS
- Anyone who wants to show attribute values as text on a map
- Anyone who wants to change the position of labels on a map
- Anyone who wants to show or hide text on a map depending on the scale
Introduction
In QGIS, you use the labeling feature to show attribute values on the map.
Adding labels to a map makes information easier to convey visually and helps readers understand the data. This article explains how to show labels for vector data in QGIS.
Basics of showing labels on vector data
First, check the attribute data of the vector data you want to label.
This example uses administrative area data for Tokyo. The attribute table shows that the N03_001 column holds the prefecture name, the N03_003 column holds the county name, and the N03_004 column holds the municipality name.

Now label the administrative area polygons with the municipality names (N03_004).
Right-click the administrative area layer in the Layers panel and open the Layer Properties dialog. Select the Labels tab on the left. By default, the drop-down at the top is set to No Labels. Select Single Labels from the drop-down.

The label settings appear below. Click the ▼ button next to Value and select the column you want to show as the label.
Here, select the N03_004 column, which holds the municipality names. When you finish, click the OK button at the bottom.

The municipality names now appear on the administrative area polygons. Some municipalities show the same name more than once. This happens because they consist of multiple polygons, for example because of exclaves.

Customize the label style
Labels use a basic style by default, but QGIS lets you fine-tune how labels look.
Change the font and color
In the Text tab, you can change the font size, style, and color.

To make labels easier to see, you can also change the text color, emphasize the text in bold, and add an underline.

Adjust label placement
In the Placement tab, you can adjust where labels appear.

For polygon data, the placement mode is set to Around Centroid by default, so labels appear near the centroid of each polygon.

To change where labels appear more flexibly, change the placement mode.


Set label visibility by scale
If you zoom in and out on the map canvas with labels showing, the labels can dominate the map and make it hard to see, as in the figure below.

In QGIS, you can show or hide labels automatically depending on the scale of the map canvas. For example, labels appear when you zoom in to see a detailed map and disappear when you zoom out, which keeps the map visually clean.
You set label visibility by scale in the Rendering tab.
Select the Rendering tab and check Scale dependent visibility at the top. Then enter the range of scales at which labels should appear in the fields with the minus and plus magnifier icons. Here, labels should not appear at 1:100000 or smaller, so click the ▼ button of the field with the minus magnifier icon and select 1:100000. Click the OK button, then change the scale of the map canvas.

Labels no longer appear at scales of 1:100000 or smaller, and they appear at scales larger than 1:100000.

Labels are a convenient way to show the attributes of features as text, but showing them indiscriminately can slow down the display and clutter the map, making it harder to understand. Set visibility by scale where needed to keep the map canvas easy to read.
Label buffer settings
When labels are displayed, the text can be hard to see against the features behind it. In that case, add a buffer (outline) around the label.
You set the label buffer in the Buffer tab.
Select the Buffer tab and check Draw text buffer. You can also set the buffer Size, Color, and more, but here, keep the default settings and click the OK button.

On the map canvas, the text now has a white buffer, so it is clearly visible.

Conclusion
This article introduced the basic labeling features: showing labels, placement modes, visibility by scale, and buffers.
Labels have many other features, such as showing callouts (leader lines) and displaying multiple attributes on separate lines. Other articles will cover more advanced uses.


QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.


