Project: QGIS

Version: 3.18

Feature: Gradient ramp based legends

Anew QgsColorRampLegendNode class was added which allows for the creation of color ramp-based legend nodes. It's now used for raster layers when using a pseudocolor renderer with the linear interpolation type or for the single-band gray renderer, as well as for point clouds using a ramp based renderer.

In a layout legend, the ramp item inherits the default legend symbol width and height, but it is possible to optionally override this behavior.

There are labels included for the minimum and maximum ramp value, which are rendered using the same font settings as other legend item text:

Label alignment will follow the legend settings:

And naturally, the items will work nicely with multi-column legends:

This feature was funded by Hans van der Kwast

This feature was developed by Nyall Dawson