Class: QgsPlotAxis

class qgis.core.QgsPlotAxis

Bases: sip.wrapper

Encapsulates the properties of a plot axis.

Warning

This class is not considered stable API, and may change in future!

New in version 3.26:

Methods

gridIntervalMajor

Returns the interval of major grid lines for the axis.

gridIntervalMinor

Returns the interval of minor grid lines for the axis.

gridMajorSymbol

Returns the line symbol used to render the major lines in the axis grid.

gridMinorSymbol

Returns the line symbol used to render the minor lines in the axis grid.

labelInterval

Returns the interval of labels for the axis.

numericFormat

Returns the numeric format used for the axis labels.

readXml

Reads the axis' properties from an XML element.

setGridIntervalMajor

Sets the interval of major grid lines for the axis.

setGridIntervalMinor

Sets the interval of minor grid lines for the axis.

setGridMajorSymbol

Sets the symbol used to render the major lines in the axis grid.

setGridMinorSymbol

Sets the symbol used to render the minor lines in the axis grid.

setLabelInterval

Sets the interval of labels for the axis.

setNumericFormat

Sets the numeric format used for the axis labels.

setTextFormat

Sets the text format used for the axis labels.

textFormat

Returns the text format used for the axis labels.

writeXml

Writes the axis' properties into an XML element.

gridIntervalMajor(self) float

Returns the interval of major grid lines for the axis.

Return type

float

gridIntervalMinor(self) float

Returns the interval of minor grid lines for the axis.

Return type

float

gridMajorSymbol(self) QgsLineSymbol

Returns the line symbol used to render the major lines in the axis grid.

Return type

QgsLineSymbol

gridMinorSymbol(self) QgsLineSymbol

Returns the line symbol used to render the minor lines in the axis grid.

Return type

QgsLineSymbol

labelInterval(self) float

Returns the interval of labels for the axis.

Return type

float

numericFormat(self) QgsNumericFormat

Returns the numeric format used for the axis labels.

Return type

QgsNumericFormat

readXml(self, element: QDomElement, context: QgsReadWriteContext) bool

Reads the axis’ properties from an XML element.

Parameters
Return type

bool

setGridIntervalMajor(self, interval: float)

Sets the interval of major grid lines for the axis.

Parameters

interval (float) –

setGridIntervalMinor(self, interval: float)

Sets the interval of minor grid lines for the axis.

Parameters

interval (float) –

setGridMajorSymbol(self, symbol: QgsLineSymbol)

Sets the symbol used to render the major lines in the axis grid.

Ownership of symbol is transferred to the plot.

Parameters

symbol (QgsLineSymbol) –

setGridMinorSymbol(self, symbol: QgsLineSymbol)

Sets the symbol used to render the minor lines in the axis grid.

Ownership of symbol is transferred to the plot.

Parameters

symbol (QgsLineSymbol) –

setLabelInterval(self, interval: float)

Sets the interval of labels for the axis.

See also

labelInterval()

Parameters

interval (float) –

setNumericFormat(self, format: QgsNumericFormat)

Sets the numeric format used for the axis labels.

Ownership of format is transferred to the plot.

See also

numericFormat()

Parameters

format (QgsNumericFormat) –

setTextFormat(self, format: QgsTextFormat)

Sets the text format used for the axis labels.

See also

textFormat()

Parameters

format (QgsTextFormat) –

textFormat(self) QgsTextFormat

Returns the text format used for the axis labels.

See also

setTextFormat()

Return type

QgsTextFormat

writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool

Writes the axis’ properties into an XML element.

Parameters
Return type

bool