9

I have a classified raster with three classes. One of them has to be hollow. I added a legend which looks like this. enter image description here

Apparently, the opacity level - in this case 0% - is not transferred to the legend in the map. On the right side you can see that the color in the map is hollow. I created "hollow" by selecting any color, in this case orange, and setting the opacity to 0%. Is there any way to transfer the opacity / transparency level to the legend in the map?

This is how I got this legend:

  • Load a raster file with categorical data (in this case values 0, 1, and 2)

  • Properties -> Style -> Render type: Singleband pseudocolor -> Classify -> Choose colors (One of them was a random color, here orange, with Opacity=0%)

  • Change to new Map Composer. Add a Map and a Legend.

Result:

The legend now shows the random color. However the opacity is not forwarded to the legend.

I'm aware that in this case it might be possible to change the random color to white and thus synthesize the "hollow" color. However, I think this might be useful for other users who face this problem as well.

3
  • Can you specify the steps you took to reach your current state? I've tried a sample dataset of my own and did the same transparency reduction and the legend displayed as the Opacity was altered.
    – whyzar
    Commented Jan 24, 2017 at 3:16
  • Done. Hope I described it sufficiently.
    – loki
    Commented Jan 24, 2017 at 9:16
  • Looks to be a bug. You could set the color to white, which will look transparent if using a white background on the legend.
    – HeikkiVesanto
    Commented Jan 26, 2017 at 13:41

1 Answer 1

2

Instead of setting the opacity level to 0%, try changing the fill color to "Transparent Fill" and then update the legend. You can change the fill color by clicking on the "Simple Marker" button in the "Style" tab.

1
  • Are you sure, that this is a correct answer for Raster visualization? Even though, the raster has 3 values, only one of which should be transparent. Not the whole raster. If I get your answer wrong, show me with some screenshots please.
    – loki
    Commented Apr 14, 2017 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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