Using 3.10.1-A Coruña on Windows 10
I want to adjust my label placement options in a Python script.
I've had a look at the QgsPalLayerSettings Class Reference and similar questions at:
- QGIS Set Label Placement in Python ; and
- Setting placement labels on "Offset From Point" with OffsetX,Y parameters in PyQGIS?
but can't find where I can set the Centroid options in PyQGIS like I can in my UI shown in the pic below.
My UI looks very different to the one in the similar question at Setting placement labels on "Offset From Point" with OffsetX,Y parameters in PyQGIS?
I'm guessing it will be in the settings class. I have added settings.placement = 0 as I understand that is Around, but not sure how to set placement to Centroid:Whole Polygon and Force visible point inside polygon with PyQGIS
settings = QgsPalLayerSettings()
settings.fieldName = 'POA_CODE16'
settings.placement = 0