I am looking for a way to configure a two way graduated fill symbology, that is based on positive and negative values which corresponds to a level of error for one feature attribute (how far is it to a certain value). My issue is that the negative values don't go as far as positive values in absolute (~+400 % and ~-95 %). I don't want the reader of my map to get the message wrong, e.i. that negative (blue) error is as big as the positive (red).

Current configuration:

I also need the legend to be automatically generated by using either QGIS's the rule based or graduated symbology functionalities. With a legend that looks like this (don't pay attention to the discretion of values that are just an example):

Instead of this (like current situation):

I have a solution which is to modify the blue gradient manually to lower the saturation but as it's manual it's not rigorous scientifically speaking. I couldn't find a way to edit the gradient with an expression to make the color dependent on some values.

  • 1
    See: gis.stackexchange.com/a/433507/88814
    – Babel
    Jun 16, 2022 at 9:09
  • Thanks, but my issue is not with the position of the middle for white, it's with the end handles. One of them should have a reduced saturation to keep the difference homogeneous compared with the absolute value for deviation. In my situation it's the blue color that need to have a saturation : abs(minimum_value)/abs(maximum_value)*100 which is 33 % saturation for a situation where deviation goes from +300 % down to -100% let's say, instead of 100% saturation. I could edit the color ramp manually, but I was looking if there was a way to come up with an automatic approach for future maps. Jun 16, 2022 at 9:41
  • Please indicate the single question that you wish to ask by using a question mark.
    – PolyGeo
    Jun 16, 2022 at 10:46

1 Answer 1


You just need to manually edit the class values so they are the same above and below 0 (double click on the class value to edit), so an equivalent deviation from 0 will get the same color intensity. See below an example of result (the number between bracket are the feature number, note that dark blue have no feature)

enter image description here

  • Thanks, I was actually looking for an automatic way to get it working so I can reuse the same kind of idea for other projects, if there's any which I couldn't find. I often run into similar situations but with data other than deviation as a percentage Jun 16, 2022 at 9:32
  • 2
    @NicolasLIENART so you may have a look at the solutions linked by Babel in his comment. One suggest using the color assistant where you just have to input the max and min value (the downside is that you wont get the legend...)
    – J.R
    Jun 16, 2022 at 9:43
  • Alright, thanks for your help! Jun 16, 2022 at 10:19
  • 2
    Just add an non geometry entrie in your layer with the negative value of -400.
    – katagena
    Jun 16, 2022 at 13:00

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.