Geographic Information Systems Asked on July 31, 2021
I have been trying to format a legend in order that it appears as a color bar under the map (in the print layout). I have been able to modify almost everything but I can’t find a command to reduce the space between symbols to zero (mm).
Does anyone know how to do this?
The code until now is the following:
legend = QgsLayoutItemLegend(layout)
legend.model().setRootGroup(root)
layout.addLayoutItem(legend)
legend.attemptMove(QgsLayoutPoint(30, 200, QgsUnitTypes.LayoutMillimeters))
legend.setAutoUpdateModel(True)
legend.setItemRotation(270)
legend.setBackgroundEnabled(False)
legend.setFrameEnabled(False)
legend.setDrawRasterStroke(True)
legend.setSymbolHeight(11.0)
legend.setSymbolWidth(4.0)
legend.setEqualColumnWidth(0.0)
legend.setLineSpacing(0)
legend.setColumnSpace(0.0)
legend.setBoxSpace(0.0)
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP