Skip to main content
23 votes
Accepted

Using continuous color band for raster legend in QGIS composer legend?

A bit of a hack round to get composer to do this in QGIS 3 Add your legend, then adjust the symbol size in your legend to something small (example is 1.5mm). You'll still see white lines dividing ...
mapping dom's user avatar
  • 1,512
20 votes

Subscript labels in QGIS legends

Dealing recently with this issue I have found very helpful website Tiny Text Generator - you simply write there number/text and it translates it to small caps, superscript and subscript. You can ...
Miro's user avatar
  • 9,764
14 votes
Accepted

Modifying layer name in the layout legend with PyQGIS 3

You must set setUseLayerName() to False to name legend tree layers manually. # # previous lines # for i, layer in enumerate(layersToAdd): tree_layer = root.addLayer(layer) tree_layer....
Kadir Şahbaz's user avatar
13 votes

Subscript labels in QGIS legends

You can still use the character map to get subscript numbers in legend, as you can see below: However, subscripts are supported only in some fonts. You can refer to this link to know which fonts ...
ahmadhanb's user avatar
  • 41.1k
13 votes
Accepted

QGIS: Aligning elements in the second column in the legend

My suggestion would be to disable 'Auto Update' for the Legend and set the layer name in the legend to 'Hidden'. This will align the symbols. Disable 'Auto update' and right-click the layer name in ...
Matt's user avatar
  • 17.4k
12 votes

QGIS: Legend with more columns in one row

In the QGIS map composer, under Legend Items, you can specify the number of columns that you want in your legend e.g.: Which will produce:
dmci's user avatar
  • 4,892
12 votes
Accepted

Making legend items start in new column in ArcGIS Pro?

Using ArcGIS Pro 2.3.0, youu can select 'Legend Arrangement Options': Select 'Adjust Frame'.: Then select the item from the legend that will go in a new column and return to the 'Element' settings, ...
Ben's user avatar
  • 146
12 votes
Accepted

Feature Count in Legend (QGIS 2.18.2)

You may try a right click on your layer and then chose to Show Feature Count (green on figure):
swiss_knight's user avatar
  • 10.4k
12 votes

Why are size-scaled symbols missing from map layout legend?

I am able to reproduce your error using QGIS 3.2.0, but it works when using QGIS 2.18.21. There are also already a couple of bug reports regarding the size assistant, with this one being probably the ...
tallistroan's user avatar
  • 2,351
12 votes

Make legend in QGIS only show features in the view extent?

You can use the "Filter legend by map content" button in the print composer item properties for your legend item. The print composer legend will then only show the layers which are within your ...
Ben W's user avatar
  • 21.8k
12 votes

Showing feature count for layout extent on legend using QGIS?

I would expect the option "filter legend by map content" to cause the "filter count" to be limited to the features within the map extent. But you're right, the "feature count" is not filtered by the ...
csk's user avatar
  • 24.9k
12 votes

How to add text on top of symbols for vector layers in QGIS

Right-click the the target layer -> Properties -> Legend and click on Set Labels from expression: In expression you can write whatever you want, for example: substr( "FieldName",4,1) ...
ahmadhanb's user avatar
  • 41.1k
12 votes

Showing data from attribute table in legend in QGIS

You can use the following expression if there is one polygon. @layer_name + ' (' + to_string(array_get(array_agg( "NUMPOINTS" ), 0)) + ')'
Kadir Şahbaz's user avatar
12 votes

Adding labels on map layout legend boxes using QGIS

Under the Legend tab of the Layer Properties dialog, check and expand the Text on Symbols option. Use the Set Labels from Expression button to open an Expression String Builder, where you can select ...
Ben W's user avatar
  • 21.8k
11 votes
Accepted

Remove legend nodes of a categorized layer in a layout legend using PyQGIS

I had to dig in QGIS source code to find how QGIS does it when one reorders or removes a legend node, but here it is. It boils down to setting a custom property, then calling refresh on the parent ...
Yoann Quenach de Quivillic's user avatar
10 votes
Accepted

Group legend in ArcMap basing on field value

Here is one solution on top my head: Create a new string field and use field calculator to compute as the concatenation of other fields. Here is the python snippet: !abbrev! + ' ' + !fullname1! +'...
Farid Cheraghi's user avatar
10 votes

How to only display active layers in legend?

Use the "Filter Legend by map Content" button. The legend updates and only in the map visible layers are present in the legend (referring to QGIS Version 2.18.6).
booleeny's user avatar
  • 101
10 votes
Accepted

How to change legend orientation in QGIS?

I don't think this is currently possible as there is already an existing ticket which was updated a year ago: http://hub.qgis.org/issues/3239
Joseph's user avatar
  • 76k
10 votes

Is it possible to change legend symbols in the QGIS print composer legend?

Since this topic covers a lot of arguments, I will only focus on the SVG symbol layers, hoping that I have understood well what are you looking for (I didn't realize the length of the answer while ...
mgri's user avatar
  • 16.3k
10 votes

Removing legend items with PyQGIS without removing the layer

This is code adapted for QGIS 3 from this answer. It adds all layers except one specified. You could swap this out for a list, or conversely, use the layers you want to keep in rather than those you ...
Matt's user avatar
  • 17.4k
10 votes
Accepted

Bivariate legend plugin throws NameError exception

The file bivariate_legend.py has a missing import. Open file /Users/judithheher/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/BivariateLegend/bivariate_legend.py in any ...
Kadir Şahbaz's user avatar
10 votes
Accepted

Hiding/showing layers in legend does not work in QGIS standalone

QgsLayerTreeMapCanvasBridge must be in global scope. But you define bridge in add_legend method's scope. Therefore, variable bridge is gone after add_legend finished. One of the solutions: Add bridge ...
Kadir Şahbaz's user avatar
9 votes

Subscript labels in QGIS legends

Maybe You can try like this....
Frodo's user avatar
  • 2,407
9 votes
Accepted

Should Legend entries be singular or plural?

I asked Dr. Aileen Buckley, Esri Cartographer for her advice. She wrote a blog post that explains when you should use singular and plural for legend items. I asked, ”Is there a cartographic convention ...
Mattropolis's user avatar
  • 1,674
9 votes
Accepted

Fine-tuning horizontal legends in QGIS

I did see similar odd behaviour (QGIS 2.18.3) - as the number of columns goes up or down, you get jagged vertical columns :/ Odd. Not sure what causes that, but can suggest a work-around. To force a ...
Steven Kay's user avatar
  • 20.5k
9 votes

QGIS change legend symbol size independent of map

I suggest to : Duplicate the layer (Right click on it in the layer panel and duplicate) Give a small size to the duplicated layer Refresh in the print composer ( you will have two "Coniferous Tree" ...
Yannick Arthur DOUNGMO's user avatar
9 votes
Accepted

Legend symbol is not visable in Layout Composer when styling points with two different attributes

In QGIS 3.16.0 I did as described in the docs (in my case I applied a graduated rendering of the value "Tabell_Endring_Areal"): Click on the Symbol-button to the change it (I'm using circle)...
9ls1's user avatar
  • 1,427
9 votes
Accepted

Adding a custom legend to my layout using PyQGIS

I tested your code by running your addLegend() method in the Python console and I also experienced a crash. Interestingly, when I removed the logic from the function and simply ran the lines outside ...
Ben W's user avatar
  • 21.8k
8 votes

Using continuous color band for raster legend in QGIS composer legend?

An old question, but as I couldn't get the plugin mentioned above to work, here another work-around, tested on QGIS 3.12.3. Add a legend with limited number of discrete classes (enough to capture the ...
Ecodiv's user avatar
  • 1,809
8 votes
Accepted

Display extent indicators in the legend?

I don't believe you can do this, but one workaround is to add a dummy polygon layer to your project which has no features in it, but has the same symbology as your extent indicator. Add that layer to ...
Dan C's user avatar
  • 12.3k

Only top scored, non community-wiki answers of a minimum length are eligible