This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set legend spacing through python console in QGIS | |
| layout_name = "my_layout" | |
| legend_name = "my_legend" | |
| # Get the layout from the layout manager and the legend item by id | |
| layout = QgsProject.instance().layoutManager().layoutByName(layout_name) | |
| legend_item = layout.itemById(legend_name) | |
| # Specify spacing | |
| # space below legend title |