5

I am plotting some model outputs in QGIS and let's say I have got a given number of polygons and for each one a value which can be negative OR positive.

I need to assign to each polygon's value a colour and it needs to change between positive and negative, e.g. red for negative and green for positive.

I think that the Graduated option is the one that best suits my needs but I don't know how?

Also if this can be done, how can I apply it automatically to other layers? I have quite a few maps to do, and to do it manually would take a long time.

The idea is something like this but with polygons:

enter image description here

5

Yes, graduated is the way to go.

Open the layer style, choose graduated, and set the column to the one with the values you want to style.

enter image description here

Set the Mode to whatever best fits your range of values, and likewise set the number of classes to split your ranges into the number of bands that works best for your dataset. You can change the value of the classes if you need to by double-clicking the values.

Then go in and edit the colour ramp

enter image description here

You can then delete the stops that you don't need.

To get a similar effect to the screenshot in your question you can leave the middle stop (set at Relative position 50%) and change it's colour to be white (or transparent depending on the effect you want).

enter image description here

Then to work with the style with multiple layers you can save the Style as a .qml file (bottom left).

enter image description here

You can then apply this style to other layers by loading it as the style (or if you make copies of the .qml file and rename them the same as each shapefile it will be loaded automatically when you add the shapefile to a project)

  • thanks, I am currently doing it and if works (as it should) I will select your best answer. – aaaaa Oct 5 '17 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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