Plot.Framing

class Framing(title='', font_size=16.0, show_title=True)

The Framing specifies properties of the visual frame of the plot model (not to be confused with Plot.PlotFrame). This includes properties such as the plot title, the border line width and the background color.

Parameters:
  • title (str) – The title text.

  • font_size (float) – The title font size.

  • show_title (bool) – If True, the title is visible.

addItem(item, emit=True)

Add item as child of this item.

Parameters:
  • item (PlotItem based) – The item.

  • emit (bool) – True, if change should be emitted.

addSubscriber(subscriber)

Add a subscriber. Each subscriber is called once every time the plot item updates.

Parameters:

subscriber (bound method) – The subscriber. Must be callable.

addTag(*args)

Add tag. Used for grouping plot items.

Parameters:

*args (tuple of str) – The tags to add.

applyStyle(style_scheme=None, style_properties=None)

Apply style properties from a style scheme.

Parameters:
  • style_scheme (dict) – The style scheme.

  • style_properties (dict | None) – A specific set of style properties to apply. If None, the style properties are retrieved from the plot model using the given style scheme.

backgroundColor()
Returns:

The background color of the plot in hex format.

Return type:

str

borderLineWidth()
Returns:

The border line width in points.

Return type:

float

copy()

Make a copy of the plot storable by using the serialize/deserialize functionality.

This creates a new instance with a new id, but all other properties copied.

emit(key, value=None)

Emit a single key and value change to all subscribers.

Parameters:
  • key (str) – The key to emit.

  • value (object) – The value to emit.

fontSize()
Returns:

The font size.

Return type:

float

classmethod fromProperties(properties)

Create a plot storable from a dict of properties.

Used when deserializing a PlotStorable.

Parameters:

properties (dict) – The properties which are used to populate the properties dict of the newly created plot storable.

Returns:

The newly created PlotStorable.

Return type:

PlotStorable

hoverDetails()
Returns:

The current hover details.

Return type:

dict | None

isBottomBorderVisible()
Returns:

Whether or not the border is visible.

Return type:

bool

isHoverable()
Returns:

True, if hoverable.

Return type:

bool

isHovered()
Returns:

True, if the item is hovered.

Return type:

bool

isLeftBorderVisible()
Returns:

Whether or not the border is visible.

Return type:

bool

isRightBorderVisible()
Returns:

Whether or not the border is visible.

Return type:

bool

isSelectable()
Returns:

True, if the item is selectable.

Return type:

bool

isSelected()
Returns:

True, if the item is selected.

Return type:

bool

isTitleVisible()
Returns:

Whether or not the title is visible.

Return type:

bool

isTopBorderVisible()
Returns:

Whether or not the border is visible.

Return type:

bool

isVisible()

Not implemented for Framing.

items(selected=None, tag=None)

Return the requested items.

The optional selected key word filter selected and deselected lines, with the options:

  • True : Only selected items

  • False : Only unselected items

  • None : All items.

Parameters:
  • selected (None | bool) – True, if only selected items should be returned.

  • tag (str) – The tag to filter on.

Returns:

The child items with the selected filtering.

Return type:

items

model()
Returns:

The model that this item belongs to.

Return type:

PlotModel | None

order()
Returns:

A number describing the current order of the item within the PlotModel. Can be used for sorting.

Return type:

int | None

owner()
Returns:

The owner type.

Return type:

int | enum

parent()
Returns:

The parent.

Return type:

PlotItem based | None

removeItem(item, emit=True)

Remove item from the child items.

Parameters:
  • item (PlotItem based) – The item to remove.

  • emit (bool) – True, if removal should be emitted.

removeSubscriber(subscriber)

Remove a subscriber method from the plot item updates.

Parameters:

subscriber (bound method) – The subscriber. Must be callable.

selectionDetails()
Returns:

The current selection details.

Return type:

dict | None

setBackgroundColor(color)

Set the background color of the plot.

Parameters:

color (str) – The color to set in hex format.

setBorders(line_width=None, show_left_border=None, show_right_border=None, show_top_border=None, show_bottom_border=None)

Set border properties.

Parameters:
  • line_width (int) – The border line width.

  • show_left_border (bool) – If True, the left(polar) border is visible for rectilinear(polar) projections.

  • show_right_border (bool) – If True, the right(inner) border is visible for rectilinear(polar) projections.

  • show_top_border (bool) – If True, the top border(end) is visible for rectilinear(polar) projections.

  • show_bottom_border (bool) – If True, the bottom(start) border is visible for rectilinear(polar) projections.

setFontSize(font_size)

Set the font size for the plot title.

Parameters:

font_size (float) – The absolute font size in points.

setHoverable(hoverable)

Enable or disable hover evetn. When enabled the line will be set to hovered, once the mouse hovers over the item.

Parameters:

hoverable (bool) – True, if the item should be sensitive to hover events.

setHovered(hovered, details=None)

Set hovered with some details. This is called once the mouse hovers over the item. Should only be called once hoverable has been enabled.

Parameters:
  • hovered (bool) – True, if the item was hovered.

  • details (dict | NoneType) – The hover details.

setOwner(owner)

Set the owner of the item (either OWNERS.MODEL or OWNERS.VIEW).

Parameters:

owner (int | enum) – The owner type.

setSelectable(selectable)

Set whether this item is selectable.

Parameters:

selectable (bool) – True, if the item should be selectable.

setSelected(selected, details=None)

Set the item as selected or unselected.

Parameters:
  • selected (bool) – True, if item should be selected.

  • details (dict | NoneType) – The selection details.

setText(title)

Set the title text.

Parameters:

text (str) – The title text.

setTitle(title)

Set the title text.

Parameters:

text (str) – The title text.

setTitleVisible(visible)

Set the title visibility.

Parameters:

visible (bool) – If True, the title is visible.

setVisible()

Not implemented for Framing.

styleProperties(style_scheme)

Check if the given style scheme has a style for this item.

Parameters:

style_scheme (dict) – The style scheme.

Returns:

The style, if any.

Return type:

dict | None

tags()
Returns:

The set of tags.

Return type:

set

text()
Returns:

The title text.

Return type:

str

title()
Returns:

The title text.

Return type:

str