QGIS Script · Python
Layer Colour Classifier
Applies a yellow → green graduated colour style to any numeric attribute on a vector layer. Choose between equal-interval discrete steps or percentile quartiles. The style applies in-place to the layer — instant visual ranking in the QGIS canvas.
What you get
classify_layer.pyWhat it does
Yellow → green gradient
Applies a clear low-to-high colour ramp using the yellow-green palette — immediately legible for any ranking or continuous value field.
Discrete or percentile
"discrete" divides the full range into 0.1-width equal steps. "percentile" divides by data distribution into four quartiles regardless of value range.
In-place style update
The style is applied to the layer renderer directly — no new file is created. The change is visible immediately in the QGIS canvas.
Any numeric field
Change the column name at the bottom of the script to classify any numeric attribute — NDVI, height, area, score, or custom field.
How to use it
- 1
Load your vector layer and check (tick) it in the Layers panel.
- 2
Open Plugins → Python Console → Show Editor.
- 3
Paste the script. At the bottom, set
column(the field name to classify) andmethod("discrete"or"percentile"). - 4
Click Run. The layer style updates immediately.
Requirements
- QGIS 3.28 or newer
- First checked vector layer with a numeric attribute field
Also in the GIS Utilities Pack
Get all 4 GIS utility scripts for $25 — save $5 vs buying individually.