2

When I add a legend in a map composer in QGIS, all layers that are defined in the project will be shown in the legend, no matter if they are set to be displayed or not, I also have some background maps I would like to never show up in the legend.

So: 1) Is there a way to tell Qgis not to list layers that are not displayed in the legend? 2) Is there any way to tell Qgis to never list a layer in a legend?

(In my case, I would like to never ever show the background layers or the non-displayed layers the legend)

(using Qgis 3, but have had the same issue for quite a few 2.x versions as well)

2
  • 1
    Does anyone have an answer to the original question? I would also like to prevent layers from appearing in the legend. The problem with turning off auto update and removing unwanted layers is that every time I need to update the legend it adds those layers back again. This is painful when updates are common, especial when I have multiple sheets.
    – Sangster
    Nov 21, 2018 at 0:45
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
    – JGH
    Nov 21, 2018 at 1:49

3 Answers 3

2

In the print composer, you are able to control the contents of the legend by turning off the Auto Update. (The Checkbox in the upper left hand corner of the legend control window above the layer list)

enter image description here

Then after that box is unchecked Click on the Blue Funnel to instruct the print composer to only display the currently displayed layers.

enter image description here

You can then use the "-" button to hide other layers of your choosing.

I have highlighted the Background image here with the palette.

enter image description here

I then click on the "-" button beneath the layer list to remove that layer from the legend.

enter image description here

That is how it works for me.

1
  • 1
    This is how it works for me as well, and that is what I want to avoid having to do each time I update the legend for some reason. Dec 4, 2020 at 9:50
2

In QGIS 2.x you can remove layers from the legend in the print composer.

  1. Add legend to the print composer
  2. Select the legend in print composer
  3. In the item properties uncheck the Auto update checkbox
  4. You can customize legend, "-" to remove layer from legend. enter image description here
1
  • Quite late to comment on this, but I know how to remove a layer from the legend, I want it not to show up there when updating. Dec 4, 2020 at 9:48
1

Regarding question 2: You could use "Filter legend by map content" to get only those layers which are set as visible. See https://gis.stackexchange.com/a/294288

1
  • Thank you, but that will still list all layers that are within the viewport of the map, I want some layers not to show up at all. Dec 4, 2020 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.