Hi all Iam trying to make a print layout using a defined rectangle. The print layout created using the rectangle is correct in the x coordinates but in the y coordinates it is always smaller than the defined rectangle. *The code snippet is:* layout = QgsPrintLayout(project) layoutName = "PrintLayout" #initializes default settings for blank print layout canvas layout.initializeDefaults() layout.setName(layoutName) manager.addLayout(layout) map = QgsLayoutItemMap(layout) map.setRect(20, 20, 20, 20) #defines map extent using map coordinates rectangle = QgsRectangle(float(bounds[0]),float(bounds[1]),float(bounds[2]),float(bounds[3]))# x min y min, x max y max rectangle = QgsRectangle(QgsPointXY(float(bounds[0]),float(bounds[1])),QgsPointXY(float(bounds[2]),float(bounds[3])))# x min y min, x max y max map.setExtent(rectangle) layout.addLayoutItem(map) #Move & Resize map on print layout canvas map.attemptMove(QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)) map.attemptResize(QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters))
Any ideas what is wrong with my code? Thanks in advance Kind regards, Asim
_______________________________________________ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user