[GIS] Using continuous color band for raster legend in QGIS composer legend

legendprint-composerqgisraster

I'm looking for a way to insert continuous colour legend for a raster layer.
I managed to create discrete symbols with values along the bar, but I would like to have a continuous bar with some values on the bar, similar to the old plugin "One-Band Raster", that it doesn't work with the QGIS version higher than 1.7

I tried to set in properties->style, where I selected the Render Type "Singleband pseudocolor" and see the "generate new color ramp" box. I tried both "Continuous" or "Equal interval". However, in the Composer the legend always is displayed with discrete symbols.

Is there any way that can make QGIS Composer to display a nice continuous band for a raster layer?

Best Answer

Update: QGIS 3.18 now has built in support for gradient color band legend items, so the previous workarounds are no longer necessary!

For earlier versions:

Another option is to add a rectangle shape to the composition, then style the rectangle using a gradient fill with the same color ramp as your raster. This can be done directly in QGIS, no image editing or html required.

enter image description here

Related Question