scistag.plotstag.plot_layer.PlotLayer

class PlotLayer(fixed_size=None)[source]

Bases: object

The PlotLayer visualizes a plot’s content.

Such content types can be bar graphs, scatter plots, line graphs, pie charts, images, matrices etc.

Parameters

fixed_size (Size2D | None) – If specified this layer will try to enforce the size specified in pixels, e.g to guarantee a 1:1 projection of an image or matrix with a desired content cell to pixel ratio.

Methods

paint

Paints the layer's content :type canvas: Canvas :param canvas: The target canvas into which the content shall be painted.

update_layout

Updates the layout (especially .size) with the size foreseen by the plot :type desired_size: Size2D | None :param desired_size: The proposed size by the plot :type forced_size: Size2D | None :param forced_size: Enforced size i f the size can under no circumstances be influenced by a layer.

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

fixed_size

The fixed size.

size

The effective size of this layer in pixels

value_range

The range of the values stored in this layer

needs_clipping

Defines if the layer needs to be precisely clipped because it can not be guaranteed that all elements will be painted precisely inside.

abstract paint(canvas)[source]

Paints the layer’s content :type canvas: Canvas :param canvas: The target canvas into which the content shall be

painted.

update_layout(desired_size=None, forced_size=None)[source]

Updates the layout (especially .size) with the size foreseen by the plot :type desired_size: Size2D | None :param desired_size: The proposed size by the plot :type forced_size: Size2D | None :param forced_size: Enforced size i f the size can under no

circumstances be influenced by a layer.

fixed_size: Size2D | None

The fixed size. If specified the plot will try to enforce this size

needs_clipping

Defines if the layer needs to be precisely clipped because it can not be guaranteed that all elements will be painted precisely inside.

size: Size2D

The effective size of this layer in pixels

value_range: PlotValueRange2D | PlotValueRange3D

The range of the values stored in this layer