This question already has an answer here:

How can I hide the positive contour labels covering the green area and only display the negative contour labels over the ocean areas? I am using QGIS 2.18.2. The contour file is a separate layer and when I enable labels I cannot hide the positive contours. Refer to the image below.

Contours showing up on land area

marked as duplicate by underdark qgis May 26 '17 at 18:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can use the if statement to only show values which are negative, something like the following:

if("fieldName" < 0, "fieldName", '')



  • Before using if statement (blue = positive contours; red = negative contours):

    Before statement

  • After using if statement:

    After statement

  • Hi Joseph. This worked perfectly and the display is perfect now. Thank you very much indeed. I had spend hours working on this problem. – ChrisW May 26 '17 at 14:22
  • 2
    @ChrisW it this answer solved your problem, please accept it: it will help future readers. – mgri May 26 '17 at 14:23
  • @ChrisW - Most welcome, glad it helped :) – Joseph May 26 '17 at 14:28

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