2

Is there a non manual way to control the colour ramp in symbology based on value.

In my example below I have values that can be positive or negative, i want everything positive to be one colour and negative the other with values around zero as white.

enter image description here

How does QGIS decide where to place the break in colour? Double clicking on the ramp brings me this set of options but the figures at bottom don't correspond to the figures in the source data.

enter image description here

Answer given by Eric below, screen grab is that applied to my example for those who can't translate the German. This still leaves you with some manual edits to make, for most automated solution see my solution

enter image description here

2 Answers 2

2

I usually use rule-based coloring for that kind of tasks.

Rule/color 1: "value" < lower threshold/negative

Rule/color 2: "value" > upper threshold/positive

Rule/color 3: "value" > lower threshold AND "value" < upper threshold/around zero

Following image for gradient colors within each rule enter image description here

6
  • Can i combine that to have multiple tones of the colour? Ie everything above value 1 is green but tint is a continuous variable? Jun 19, 2018 at 13:30
  • Yes, you can do so. I added a screenshot to my answer, though it is in german (sorry), it should give you an idea where to look.
    – Erik
    Jun 19, 2018 at 13:44
  • This gives some odd behaviours with negative values! Jun 19, 2018 at 15:00
  • Could you be more specific?
    – Erik
    Jun 19, 2018 at 15:02
  • If it set "rate_change" <= -0.01 i expect to see only negative values when i then apply ranges to rule but i also get some positive ones, you can see this in screenshot i put in my quesiton Jun 19, 2018 at 15:07
2

For reference for others the most efficient way to tackle this (for my example) was to duplicate the layer to create three separate layers and use the layer filter function to band them into values around zero, values over 1 and values under minus 1; enter image description here

Then use symbology tool (layer properties) as normal to let QGIS decided on what colour to apply to what value based on your gradient ramp.

enter image description here

Many thanks to Erik for the hint on this. With this solution QGIS still does the heavy lifting of dividing up the data into colours but you retain the fine control of where the colour bands start.

1
  • That's a trick I'll keep in mind!
    – Gabriel
    Jun 20, 2018 at 12:22

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.