# Creating proportional symbols in QGIS that are then graduated by another variable

I have a table that features two variables that I want to visualise - total population and percentage of total population affected. I need to find a way of including both of these variables in the visualisation and can't see an easy way to do it.

I can create a proportional symbol map easily by graduating the total population by size, but I then want to colour the proportional symbols based on the percentage of affected population. I can't find an obvious way to do that.

I can't manually change the colourings, as the percentages don't relate directly to the total populations so I need to find some way of writing a query that says create proportional symbols based on the total population and then graduate those based on the percentage affected. I'm using QGIS 3.4.1 if it matters.

• I think you should provide an example of your current settings. Because right now I'd say "use graduation on the percentage", and do the symbol size via `data defined override`. – Erik Sep 29 '20 at 13:24
• Is this what you're trying to do? imgur.com/56EmnA9 – TeddyTedTed Sep 29 '20 at 13:32
• This solution is a good answer – Cupain Apr 15 at 8:10

It is possible to create styles using more than one attribute.

Assign the first style as usual, for example total population by color or size. Ideally, aesthetically, you should work with the same number of intervals for both variables, say 5.

For the second attribute you must first find out the range of values (I guess 0-100%) and decide how many intervals you want. For example, 5 intervals, 0-20%, 20-40%,40-60%,60-80%,80-100%.

Then, check if each interval of `population size` has the 5 intervals of %. You do this with select by expressions. This way we avoid creating unnecessary intervals.

In the layer properties dialog box or in the style panel, change the symbology to rule-based. You will see 5 rules that correspond to the population size symbology, we will edit these rules, click on the button with the letter E to open the expression dialog.

When we open the first rule, we concatenate another conditional with, this way: "total population"<10000 and percentage < 30".

After you edit the initial rules, you can duplicate them, with copy and paste, for example, "total population"<10000 and percentage < 30", you will change it to "total population"<10000 and percentage >= 30 and percentage < 60". Here you generate the first color change (or symbol)!!.

This way you continue with the rest of the rules, in the worst case you will have to create 25 additional rules (uncommon).

For the layout, you must edit and create your own legend that fits the symbolism created. I show you an example of an earthquake map

After editing the labels in the layer panel it looks like this

In the case of polygons, using a similar procedure you can apply multiple attributes using the 2.5D style, as you see in the image