Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a plugin or method to add legends for raster layers (with a custom colourmap) as an item in the print composer?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

"Colour Scale Bar" is a plugin (QGIS contributed repository) which does this. It only works with discrete interpolation!

Once you have set up a raster layer in the way you like, you save the style (Layer|Properties... then click Save Style) and select the saved .qml file in the plugin dialogue.

The legend is saved as a PNG file, which you can then add as an image in the print composer.

Elevation legend for E/C Africa map]

share|improve this answer
    
just the thing, thanks! –  Alex Jan 26 '12 at 5:10
    
No worries ... something I found confusing with the dialogue is that the 'box size' refers to the size of the colour patches in pixels, not the entire legend! Updated the graphic with a 20x30px patch size legend. –  Simbamangu Jan 26 '12 at 5:20
add comment

You can use 1.8 version of QGIS or higher (QGIS master) to have raster legend in map composer available by default.

share|improve this answer
    
+1 - hadn't even noticed that option! That works with linear colormap, too, not just discrete. –  Simbamangu Jan 27 '12 at 9:33
    
ahhh, well, I'll have to wait for the release :) –  Alex Jan 27 '12 at 10:07
add comment

You can solve this problem in this way: Once you have set up a raster layer in the way you like, press "Print Screen" while Colormap window it's open, then save it as image, and add it in your map.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.