Skip to main content
minor phrasing adjustment
Source Link
TimD
  • 439
  • 4
  • 11

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then I clean up the legend items, renaming the raster layer's entry in the legend, removing the Band 1 sub-title, and removing the My Vector Layer legend item. enter image description here

This results in a print layout like the following. Note that I have hidden the bogus raster filelayer from the projectmap:

enter image description here

I can also use the Orientation parameter to make it a horizontal legend patch: enter image description here

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then I clean up the legend items, renaming the raster layer's entry in the legend, removing the Band 1 sub-title, and removing the My Vector Layer legend item. enter image description here

This results in a print layout like the following. Note that I have hidden the bogus raster file from the project:

enter image description here

I can also use the Orientation parameter to make it a horizontal legend patch: enter image description here

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then I clean up the legend items, renaming the raster layer's entry in the legend, removing the Band 1 sub-title, and removing the My Vector Layer legend item. enter image description here

This results in a print layout like the following. Note that I have hidden the bogus raster layer from the map:

enter image description here

I can also use the Orientation parameter to make it a horizontal legend patch: enter image description here

Added some detail
Source Link
TimD
  • 439
  • 4
  • 11

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then after some cleanup ofI clean up the legend items, renaming the raster layer's entry in the legend, removing the (deletingBand 1 sub-title, and removing the items we don't want to see) I can createMy Vector Layer legend item. enter image description here

This results in a print layoutslayout like the following. Note that I have hidden the bogus raster file from the project:   

enter image description here Including using

I can also use the configurationOrientation parameter to make it a horizontal legend patch: enter image description here

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then after some cleanup of the legend items (deleting the items we don't want to see) I can create print layouts like the following:  enter image description here Including using the configuration parameter to make it a horizontal legend patch: enter image description here

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then I clean up the legend items, renaming the raster layer's entry in the legend, removing the Band 1 sub-title, and removing the My Vector Layer legend item. enter image description here

This results in a print layout like the following. Note that I have hidden the bogus raster file from the project: 

enter image description here

I can also use the Orientation parameter to make it a horizontal legend patch: enter image description here

Source Link
TimD
  • 439
  • 4
  • 11

Raster layers can be configured to display a gradient color-ramp legend. This functionality can be leveraged to create a faux legend to accompany a vector layer. This workaround is more convoluted than the other 'insert a rectangle' workaround, but it does result in a native legend item, which might be preferable in some situations.

For starters, here is my vector point layer styled using a color ramp. This screenshot shows a simple Print Layout consisting of a map and the default legend: enter image description here

Now I add a random raster file to my project. I have added a small GeoTIFF of DEM data. I then set its symbology to use the same color-ramp as the vector layer: enter image description here

Next, in the Print Layout's legend's properties, I can configure the raster layer's legend item with values to make it appear to represent the vector layer: enter image description here

Then after some cleanup of the legend items (deleting the items we don't want to see) I can create print layouts like the following: enter image description here Including using the configuration parameter to make it a horizontal legend patch: enter image description here