Making a map with Print Layout
Last updated
Last updated
Once you've created, added and manipulated your data in your QGIS project, you might want to export it as an image to print or share it. The reason is, a GIS map file is not an image. Rather, it saves the state of the GIS program, with references to all the layers, their labels ,colours, etc. So for someone who doesn’t have the data or the same GIS program (such as QGIS), the map file will be useless. Luckily, QGIS can export its map file to a format that anyone’s computer can read, as well as printing out the map if you have a printer connected. Both exporting and printing is handled via the Print Layout.
Saying this, it is not always necessary to share your map in this way. If you want to share your project with someone else who does have QGIS, then there are a couple of different ways to share your QGIS project and the underlying data into one, neat file. But for now, we will learn how to create a map/figure/graphic which can then be used in a report or online, for example.
We will use our original QGIS project for this exercise, so open that project up to start off with. We are going to make a map of the whole of Antarctica and I would suggest that you just have 2 or 3 of your layers turned on. Perhaps the coastline, facilities and contours, although you can show the penguin locations as well if you want.
Click on Project ➤ New Print Layout and name your layout something self-explanatory. A new window will open with a blank white piece of 'paper'. This is a blank canvas for creating your map.
You can have multiple layouts in a QGIS project. These can be managed by Project, Layout Manager. If you have multiple layouts, this is when naming them something helpful is a good idea.
2. Right-click on the white sheet and choose 'Page properties'. The size and orientation now appears on the right-hand side. This is where the properties of whatever item you have selected appear. We're going to make a square figure, so change your width and height to 210 x 210 mm.
3. Click on the Add Map button on the left-hand side. With this tool activated, you will be able to place a map on the page. Click and drag a box n the blank page (any size for now).
4. Move the map by clicking and dragging it around. Resize it by clicking and dragging the boxes on the edges.
5. Some of the most useful tools for getting your initial layout sorted out are highlighted in the screenshot below. The pan button allows you to move around the page (useful when zoomed very far in). Select is for selecting any item on the page. And Move item is for moving the content of your map (ie moving Antarctica so that it is centred nicely).
6. In the screenshot above, I have added a frame to my map and I have made it a nice round size. This was done in the Item Properties of the map. Select your map (click Select tool, select your map) and look in the properties on the right-hand side to see what you need to change:
The scale is set at 30,000,000 which fits Antarctica nicely in the frame.
The 'Position and Size' are set with an X and Y of 10, and height and width of 190. If you don't understand how these numbers control the size and placement, have a play around with the numbers to see what changes.
The 'Frame' option is ticked on. You could also add a background if you want - a nice shade of blue can often look nice.
Another useful section in the 'Item Properties' is the ability to lock your layers. At the moment, if you go back to your QGIS project and add any more layers, or change the styling of them, then these changes will feed through to your layout. It is very easy to add more data without thinking, or to alter the styling in your project, and then when you come back to your layout later on, it will look completely different. We therefore want to lock the layers, as detailed now:
7. 'Select' your map panel (if not already selected) to make the Item Properties show up on the right hand side again. Find the section named Layers, and tick 'Lock layers' and 'Lock styles for layers', as shown in the image below.
Now, if you change your layers in your project, nothing will happen. Remember that you have done this though! If you do want to add more data, then just untick these options, turn the data on in your project, and then lock the layers again.
Nearly every single map should have a scale bar. Here is how to add and adjust one to your map:
8. Find the 'Add Scale Bar' button along the left-hand side (little ruler symbol). Select this, and then click and drag a rectangle in the corner of your map. A scale should appear!
9. With this scale bar selected, you can see the Item Properties available for this item on the right again. Have a quick look through these and change some things that you might think are useful, such as the 'Style', 'Segments', and 'Height'.
Next we will add some very simple labels to your map.
10. Select the 'Add Label' button along the left-hand side (T symbol).
Click and drag a box on your map. It will fill with some latin.
The Item Properties will appear on the right. Change the text in the box to what you want (maybe start with 'East Antarctica'.
To change the font, click on 'Font' in the Item Properties and select a nice font and appropriate size
To change the alignment, select 'Center' in the 'Horizontal alignment' section, just below Font.
To add further labels, you can just copy and paste your first label, or add them as you did for this
Try adding a few more labels, and make your 'water labels' (ie the names of some seas) in blue italics
One more final thing that is usually an essential part of a map, is some latitude and longitude lines, known as a graticule or grid. Unfortunately, these never seem to work well in the QGIS Print Layout. However, we will have a quick go at adding them, just so that you can see how they look.
11. Select your main map so that the Item Properties appear on the right. Find the section called 'Grids'.
Click the green + sign to add a new grid
Click on the grid and then click 'Modify Grid'
Under 'CRS', select 'Default CRS: EPSG 4316'. This is because we want our grid to show lines using normal lat and lon (and not metres)
Set your X (longitude) and 30 or 45, whichever you thinks works best, and set your Y (latitude) at 10.
Your map should automatically update
Can you see that the circles are not very 'round', and that it is missing a line at 180°? This is very frustrating for those of us mapping Antarctica!
12. Go back from the 'modify' area and either leave your grid if you are happy with it, or just delete it by using the red - sign.
13. What I often do instead, is add a new data layer in my project which contains nice lat and lon lines, and then have this as an extra layer on my map! If you want to try this and have time, here is a shapefile which I downloaded from Natural Earth, but don't worry too much about this:
Once you are happy with your map, it is possible to export it in a number of formats including .png, .svg and .pdf. Go ahead and export as an image for now, and open your file up afterwards to see how it looks.
As before, if you have finished with time to spare, here is another option for you to try:
Create a new Print Layout (Project ➤ New Print Layout) and on this map, show the features/region that you digitised in the 'Creating data' section
OR, open your REMA QGIS Project and make a Print Layout of your hillshade and contours
You will have to zoom much further in for this, and you might want a differently shaped layout rather than a square
Your graticule will also need to be different, and you will likely want to label different features on this
Information source:
https://docs.qgis.org/3.16/en/docs/training_manual/map_composer/map_composer.html