7

I have a map with a large number of polygons that I want to colour individually for display purposes. There is not particular pattern required, only to present them as individual catchments in a figure.

Is there a method to achieve this in QGIS?

1

6 Answers 6

7

Use a Categorized style on the layer.

enter image description here

7

In QGIS 2.8.1 version, Right click on the layer. Go to Layer Properties. Clcik Styles Tab. Select drop down value Categorized. Use Random colors from Color Ramp drop down list.

2

With 'unic symbol' symbology, you can set the value of the color with an expression:

rand(0,255)||','||rand(0,255)||','||rand(0,255)

to simulate the RGB value like (250,0,6)

1
  • 2
    I think it shall be color_rgb(rand(0, 255), rand(0, 255), rand(0, 255))
    – Taras
    Commented Sep 22, 2020 at 4:51
1

Right-click properties on the feature, then choose 'Categorized' in Symbology tab. Choose your Value, make sure Color ramp is on "Random Colors" and then select 'Classify' to add those values to assign the random colors and Apply.

1

You could use the processing tool Topological coloring to ensure a suitable random coloring where no neighbours get the same color.

This algorithm assigns a color index to polygon features in such a way that no adjacent polygons share the same color index, whilst minimizing the number of colors required.

It creates a copy of your layer and adds an attribute "color_id", you can then use e.g. with the already named random colors categorized style or the already named expression for use in data defined override.

enter image description here

enter image description here

0

Double click your layer got the symbiology tab. Change single symbol to categorised.

enter image description here

Select the value you want to classify your data on and set the color ramp to "random colours". Press classify at the bottom and apply your settings.

enter image description here

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.