I'm trying to make an atlas with qgis with a map generating 2 pages (north and south) N and S corresponding to the coverage layer where a field contains the values "N", "S". Every page is formed by the map zoomed on N or S (this is not a problem) and a part where I want the 2 value "N" e "S" changing the font-color: N red and S grey if the atlas zoom the north, N grey and S red if the atlas zoom the south.

I think I can use a conditional expression with label but I'm not able find a way.

To clarify, my problem is the realization of N and S outside the map in the layout with different color:

enter image description here


2 Answers 2


Since the font color of labels in print composer in QGIS 2.18 can not be data-defined, a workaround is needed. One possible approach is to duplicate the the "N" and "S" labels with black versions on the bottom covered by red versions. The label text can then be written as an expression which only shows the red label if the atlas feature attribute has the corresponding value:

enter image description here

enter image description here


Make a rule based symbology and try this:

first rule/filter: $id = @atlas_featureid and make your symbology.

second rule/filter: $id <> @atlas_featureid and make your symbology.

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.