Class: QgsPlotRegistry

Registry of available plot types.

QgsPlotRegistry is not usually directly created, but rather accessed through QgsApplication.plotRegistry().

Added in version 4.0.

Class Hierarchy

Inheritance diagram of qgis.core.QgsPlotRegistry

Base classes

QObject

Methods

addPlotType

Registers a new plot type.

createPlot

Creates a new instance of a plot given the type.

plotMetadata

Returns the metadata for the specified plot type.

plotTypes

Returns a map of available plot types to translated name.

populate

Populates the registry with standard plot types.

removePlotType

Removes a new a plot type from the registry.

Signals

plotAboutToBeRemoved

Emitted whenever a plot type is about to be remove from the registry, with the specified type and visible name.

plotAdded

Emitted whenever a new plot type is added to the registry, with the specified type and visible name.

class qgis.core.QgsPlotRegistry[source]

Bases: QObject

__init__(parent: QObject | None = None)

Creates a new empty plot registry.

QgsPlotRegistry is not usually directly created, but rather accessed through QgsApplication.plotRegistry().

See also

populate()

Parameters:

parent (Optional[QObject] = None)

addPlotType(self, metadata: QgsPlotAbstractMetadata | None) bool[source]

Registers a new plot type.

Note

Takes ownership of the metadata instance.

Parameters:

metadata (Optional[QgsPlotAbstractMetadata])

Return type:

bool

createPlot(self, type: str | None) QgsPlot | None[source]

Creates a new instance of a plot given the type.

Parameters:

type (Optional[str])

Return type:

Optional[QgsPlot]

signal plotAboutToBeRemoved(type: str)[source]

Emitted whenever a plot type is about to be remove from the registry, with the specified type and visible name.

Parameters:

type (str)

signal plotAdded(type: str, name: str)[source]

Emitted whenever a new plot type is added to the registry, with the specified type and visible name.

Parameters:
  • type (str)

  • name (str)

plotMetadata(self, type: str | None) QgsPlotAbstractMetadata | None[source]

Returns the metadata for the specified plot type. Returns None if a corresponding type was not found in the registry.

Parameters:

type (Optional[str])

Return type:

Optional[QgsPlotAbstractMetadata]

plotTypes(self) Dict[str, str]

Returns a map of available plot types to translated name.

Return type:

Dict[str, str]

populate(self) bool[source]

Populates the registry with standard plot types. If called on a non-empty registry then this will have no effect and will return False.

Return type:

bool

removePlotType(self, type: str | None) bool[source]

Removes a new a plot type from the registry.

Parameters:

type (Optional[str])

Return type:

bool