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. 1. Add a legend with limited number of discrete classes (enough to capture the gradient). 2. In the composer, add the raster layer and legend. 3. Under symbol, reduce the height of the symbols (1), deselect the ‘draw stroke for raster symbol’ (2), and under spacing, increase the spacing between symbols (3). [![enter image description here][2]][2] 4. Place a rectangle next to the legend, and select as style gradient fill. 5. Select the colour ramp, and then the option to edit it. 6. Now, add as many stops, minus two, as you have colours (1). Place the stops at the right relative distances (2) and use the sample colour function (3, 4) to define the colours. [![enter image description here][3]][3] 7. Now you can move the rectangle on top of the legend symbols to complete it. Group the two together to make it easier to freely move the legend around. More details at [Ecodiv.earth][1] [![enter image description here][4]][4] [1]: https://ecodiv.earth/post/legend-for-continuous-raster-in-qgis-composer/ [2]: https://i.sstatic.net/2cXSd.png [3]: https://i.sstatic.net/o5XhH.png [4]: https://i.sstatic.net/hoeZ6.png