Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 210574

Print composer provides growing layout and printing capabilities in QGIS.

1 vote
Accepted

Adjust Symbol Size for Color Ramp in Print Layout Legend with Python

I finally did it, thanks to a post on StackOverflow: for tree_layer in legend.model().rootGroup().children(): # access the legend's nodes if tree_layer.name() == layer_name: # confirm you have t …
Noxy's user avatar
  • 316
1 vote
2 answers
101 views

Adjust Symbol Size for Color Ramp in Print Layout Legend with Python

I have a Print Layout, with a layer, styled with a color ramp. I create it all with PyQGIS. How do I, again from PyQGIS, access these two settings Width and Height??
Noxy's user avatar
  • 316
2 votes

Modifying layer name in the layout legend with PyQGIS 3

There's another way, figured out with heavy inspiration from the QGIS API on QgisLayoutItemLegend: legend = QgsLayoutItemLegend(layout) legend.setAutoUpdateModel(False) # legend derived from the map' …
Noxy's user avatar
  • 316
2 votes

Changing the layer name in Legend for QGIS Print Layout with Python

(Hack-ish Workaround - Proper Solution in the Accepted Answer) After trying it out for a few hours, I finally figured it out. I was on the right path with QgsLayerTreeLayer, however, I was editing the …
Noxy's user avatar
  • 316
1 vote
Accepted

Changing the layer name in Legend for QGIS Print Layout with Python

It turns out my previous answer was still just a workaround, and if I edited the legend afterwards, it would realize as much and reset itself. Alas, here is the actual solution, with heavy inspiration …
Noxy's user avatar
  • 316
2 votes
3 answers
967 views

Changing the layer name in Legend for QGIS Print Layout with Python [duplicate]

My aim is to change the layer's name only within the legend - I want to leave the layer itself untouched. I tried multiple variants of X.setName(), both on the vector layer item, the map layer and the …
Noxy's user avatar
  • 316