Not sure if this is what you are aiming to:
(1) Select Graduate and choose "values" for Columns.
(2) Set your Color ramp to Blues, perhaps
(3) Click on Symbol: --Change... button to activate Symbol selector
(4) Click on the small Epsilon button (i.e. Data defined override) right to Width
(5) Enter suitable expression something like: (5 - "classes") * ...
The rules seem not to be correct.
The first rule of your example is:
"prcptot" = "prcptot" > 0 AND "p.prcptot" <=0.09
while I guess it should read:
"prcptot" > 0 AND "p.prcptot" <=0.09
Stating "prcptot" = "prcptot"is a tautology, i.e. it gets always evaluated as true.
The fact that it is chained with a > 0 before the AND operator might ...
Right-click on the layer from the Layers Panel and then go to Layer Properties > Labels and choose the label you want to use from the Label with drop-down list (after having selected the Show labels for this layer option).
Then, go to Expression Builder and try to use a CASE WHEN expression. Something like this:
$area > 1600
If you use Single labels instead of rule-based, you could concatenate more than one field using ||. Couple this with an if statement, you could try the following expression:
if("BBT_CODE" is not NULL, "Bio_Code" || ' / ' || "BBT_CODE", "Bio_Code")
Below some help to setup rule based labeling from scratch with the new QGIS 3 API
#Configure label settings
settings = QgsPalLayerSettings()
settings.fieldName = 'myFieldName'
textFormat = QgsTextFormat()
#create and append a new rule
root = QgsRuleBasedLabeling.Rule(QgsPalLayerSettings())
rule = ...
The way to get QGIS to put sub-categories into a print legend is to make the sub-categories part of the layer's style. This means that converting your rule-based labels (with colored backgrounds) into part of the symbol style. If this method seems like too much work, see below for a rather hack-y workaround.
Convert your categorized style to a rule-based ...
There are several ways to achieve this purpose. You can always create rules for labelling, as you suggested, but you could try adding a new column to your file with the label for each desired class.
This way is beneficial compared to creating rules, because the rules will be associated with your project file, and should you move your data elsewhere, you'd ...
Okay, your approach points in the right direction, but has the wrong syntax. Please note that you can test rules and that the help in the field calculator/expression builder is worth consulting.
= > instead of >= - QGIS doesn't know how to deal with two operators right after the other.
"5" - things in " always refer to ...
You can use rule based symbology or data defined override.
Since your case is not too complex, I suggest rule based symbology because you will have a nice legend then.
Set it up the following:
In case you want to use data defined override you can do it like this for example:
Use as expression:
When "Nest" is true then 'triangle'
When "Nest" is ...
There's a (totally 100% unsupported) plugin at https://github.com/nyalldawson/topocolour which will add an attribute to your data which handles this.
You'll need to manually download that plugin and copy to your .qgis2/python/plugins folder. It's not available in the plugin repositories.
The max function doesn't operate across features, just values passed to the function. Eg
Will return 5. There's no function currently available which calculates the maximum value for an attribute across the entire layer.
QGIS uses one apostrophe for python string expression. Concatenating two text fields should be done like this:
"FieldA" + ' ' + "FieldB"
There is a space between the two single apostrophes.
You can also use sa,e principal for integer or decimal values, so long as you use to_string() before the field name.
Furthermore, you do not need to calculate a new ...
You just needed to use "=" instead of "is", surround your field name with "", and replace the () with '' around the offset values, see expression below:
WHEN "name" = 'Brooklyn Bridge' THEN '3.5, 0'
ELSE '-3.5, 0'
You should use a Rule-based renderer. Following your data, something like that:
Click on the + button for adding a rule and then insert the custom expression (as indicated in the red box above).
Remember also to click on the Apply button for applying the style.
In your case you would to represent size of the proportionality with a manual scale... It's not possible by this way as it show here
What you have to do is to define your mathematic function with scale_exp as the size assistant method:
coalesce(scale_exp(Number, 1, 11000, 1, 10, 0.3),0)
Coalesce replace the first value not null by 0.
First param: ...
Your code works fine. When you want to add a new rule, do not repeat the first 3 lines of code as this creates a new symbol renderer. Just start from
root_rule = renderer.rootRule()
And create your new rule.
I find it easier to use a function like the following:
layer = iface.activeLayer()
symbol = QgsSymbol.defaultSymbol(layer.geometryType())
Yes, either way (making expression with conditions or rule-based symbology) will work fine.
As to the expression in the attached image, you could modify it to:
WHEN "feature" = 11 AND "label" = 'Existing' THEN color_rgb(255,0,0)
WHEN "feature" = 11 AND "label" = 'Proposed' THEN color_rgb(0,255,0)
WHEN "feature" = 11 AND "label" = NULL THEN ...
You could also use the following in the Python Console to change all expressions of each rule to $id = $atlasfeatureid:
layer = qgis.utils.iface.activeLayer()
renderer = layer.rendererV2()
for rule in renderer.rootRule().children():
rule.setFilterExpression('$id = $atlasfeatureid')
The above code replaces all expressions entirely. However, if ...
From QGIS 3, there is a new QgsRuleBasedLabeling Class which would allow you to control rule-based labelling using the new API.
Rules can be added using QgsRuleBasedLabeling::Rule.
(Unfortunately, I cannot test the 2.99 version at the moment. But I would happily accept an answer if it provides a working example.)
Now I understand your point. Adding subcategory to rule-based style is not working in QGIS 2.16.2, but actually it works using QGIS 2.14.6 long term release (LTR).
Here is the output using Rule-Based Style without refine by subcategory:
Here is the refine after adding subcategry:
Only the subcategory economy under the category "Country" are styled.
You can set the Font Size to be a factor of the length of the geometry to be labeled and a number, so you would set your SIZE to an expression that uses
length($geometry) * number
note my data is in decimal degrees, which doesn't lend itself to a good example, but it does show that it works!
Then the labels display as:
Well, if i understood your question the answers is this:
You have to use "GEOMETRY (AREA) || GEOMETRY (PERIMETER)".
Step_1 - Layer > Properties > Style > Categorized > E = Insert Expression ( AREA || PERIMETER)> ok... (In this step you can add more Geometry if you have in your table)
Step_2 - classify > apply > Ok...
Step_3 - Legend (On Layers Panel).
As far as I know you cannot.
To achieve your result (not having overlaps of different symbols) you have to refine your rules to exclude this possibility. Such as:
"TOPO"=1 AND "COVER"<> 1
For your base symbol (Other), you should use the rule:
Indeed, the way it currently works is useful if you want to superpose information or create more ...
What you seek, can be easily done using the atlas features in the print composer. No need for clippings or filters. Specially if done one by one...
Create a map layout according to your needs;
Add, at least, one map item;
In the atlas generation, use the country shape as your coverage layer.
At the map item select the controlled by atlas, and set a value ...
What version of QGIS are you using?
I'm using 2.8 and I can style a layer by 'name' and also label it, and then turn off one of the features in the layer with a checkbox in the legend, and it isn't labelled any more.