[GIS] get rid of the borders around the colour boxes in QGIS Print Composer Legends

legendprint-composerqgis

If you look closely at a legend in the QGIS Print Composer, you'll see that each colour box has a hairline (1 px) border. How can I remove these borders?

By playing around with the settings, I've worked out that this colour matches the font colour setting.

example showing hairline borders

In this case the map background is black, so the only way to get rid of the border is to set the font colour to black.

However, doing this hides the labels. Black text on a black background… bit difficult to read!

I've found a (hacky) way to get around this, by

  • duplicating the legend (copy/paste)
  • set its background to transparent
  • set the font colour to black
  • set all items' text values to space (it wont let me enter an empty string)
  • remove any legend title etc.
  • drag it on top of the original legend, so that the boxes line up

However, this is a bit of a hassle, especially if there are lots of legend entries.

Is there a better way to do this?

EDIT

As of version 2.18 (or maybe earlier) this can now be controlled using a setting in Print Composer. See answer below.

Best Answer

an update to this. As of QGIS 2.18 at least, I noticed there's now an option to uncheck the Draw border for raster symbols in Print Composer:-

enter image description here

Left checked (the default), you can style the outline. Left unchecked, the outline vanishes :)

I'm not sure exactly which version introduced this, but thank you to whoever implemented this!

Related Question