2

I have a map about different locations of amphibians. I want that the colors illustrates the specific species and the form illustrates the stadium (young, adult). I know how to give different colors according to the species, but I didn't managed to also add different forms.

The problem is similar to the following one Setting symbology type and color based on data using QGIS but the answer there didn't helped me. I think it works by using rule based symbology, but I didn't managed to find out how I have to set my rules.

1
  • When creating rules, you may refine those, e.g. based on categories. The corresponding button is at the bottom left, below the plus and minus symbols.
    – Erik
    Commented Sep 9, 2020 at 14:33

1 Answer 1

3

Try this expression

CASE
   WHEN "id" IN (1,2,3,4,5) THEN 'circle'
   WHEN "id" IN (6,7,8,9,10) THEN 'square'
   ELSE 'triangle'
END

in the "Expression String Builder", see image below

example

Note: When hovering at each symbol you can see the default name of it.

For colours check this thread Multiple styles in one layer in QGIS.

5
  • 1
    Thank you very much it worked out. But now I have the problem that I want to create a map and when I add the legend it only adds the layer as one and not the single expressions (e.g. Square = Frog). Do you got a solution for this problem? Commented Sep 10, 2020 at 12:00
  • This is a small disadvantage of this approach =)
    – Taras
    Commented Sep 10, 2020 at 12:05
  • So its not possbile? Do you maybe know a diffrent approach where it is also possible to generate legend entries? Commented Sep 10, 2020 at 12:09
  • I suggest you asking it as a new question
    – Taras
    Commented Sep 10, 2020 at 12:13
  • 1
    Alright I will do that, thanks alot for your help! Commented Sep 10, 2020 at 12:15

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.