This question relates to a previous question I posted four years ago: QGIS Legend - distribution of items across columns

I've created a map and in print composer I've added a legend with ten items, which I want to break across five columns evenly. I've specified the number of columns and checked Split Layers, but the end result is three columns of two items, one column of three items, and a final column of one item:

QGIS print composer

When I originally posted a question about this, Joseph replied, suggesting I adjust the column count setting to 6, which worked perfectly, and has continued to work until a couple of months ago, when suddenly the legend items have become skewed again. Can anyone offer any further advice on how to get the columns to display evenly? Thanks.

  • Just to clarify, the image shows the legend after I've applied the suggested solution of adjusting the column count, rather than the initial state described in the preceding text. – MisterC Jul 23 '20 at 16:13
  • What version are you using? In 3.14 there is now manual breaks qgis.org/en/site/forusers/visualchangelog314/… – Baswein Jul 23 '20 at 17:51
  • I'm using 2.14, which I know is a bit old now. I'm not sure if manual breaks will solve this issue, but might try installing it on another laptop and see it it works. – MisterC Jul 24 '20 at 8:10
  • I've installed 3.14 and tested that feature. Unfortunately it just forces more of the preceding columns to split across three rows, so doesn't really solve the problem. Is this a bug with QGIS? – MisterC Jul 24 '20 at 13:39
  • So it seems like this is a known bug. github.com/qgis/QGIS/issues/37417 – Baswein Jul 24 '20 at 16:45

This does appear to be a bug but I think I stumbled across a work around. If you change the Space between symbols to less then 1 mm it will not do the weird bump to 3 and 1 in a column instead of 2 thing. Here it is at 1mm 3 and 1 instead of 2 And here it is at .99mm

.99 mm gives 2 item columns

I assume you already figured out that you need to hide your item and group titles and just use your main properties title to get it to work.

Not sure if this is helpful but there seems to be a relationship between Symbol Height and Space Between Symbols. When I have 12 items in 6 columns (2per column) 4mm/1mm doesn't work but 4mm/.99mm does as does 4.01mm/1mm. You can find similar threshold relationships as you go up in multiples of 4mm and 1mm. For example 8mm/2mm, 12mm/3mm, 16mm/4mm, 20mm/5mm. When I have 12 items in 4 columns (3per) it is 4mm/2mm 12 items in 3 columns (4per) = 4mm/4mm 16 items in 6 columns (3per) is the same as 12 items in 6 columns so it seems to be the number of columns not the number of items.

  • Hey Baswein, that has solved the problem. Thanks so much for your help, it's really appreciated! – MisterC Jul 27 '20 at 14:06
  • Glad to help. Hopefully the bug will get fixed soon. I looked at the file and assume it has to do with how the columns are summed and divided but don't know enough programming to do anything. At least it seems like there are clear work arounds now. – Baswein Jul 28 '20 at 12:09

This is a bug that has recently been fixed. In the upcoming QGIS 3.16, the legend columns should all be the same height.

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.