Graphs#

Frames#

Graph Frame#

class mhi.enerplot.GraphFrame(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

Graph Frame

A container which can hold one or more Graph Panels, stacked vertically, with a common x-axis.

add_overlay_graph() GraphPanel#

Add a new overly graph panel to the Graph Frame.

Returns:

the newly added graph panel.

Return type:

GraphPanel

add_poly_graph() GraphPanel#

Add a new poly-graph panel to the Graph Frame.

Returns:

the newly added graph panel.

Return type:

GraphPanel

remove(*graphs) None#

Remove graphs from the Graph Frame

zoom(xmin: float | None = None, xmax: float | None = None, *, compute_x_grid: bool = True) None#

Alter the x-axis viewport for all graph panels in this graph frame

Added in version 2.2.1.

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

copy_as_bitmap() None#

Copy component to clipboard as a bitmap

copy_as_metafile() None#

Copy component to clipboard as a metafile

cut() None#

Remove the component to the clipboard

Delink all channel data from the frame

extents(x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) Tuple[int, int, int, int] | None#

Get or set the component’s position and size

If all parameters are given, the position and size is set. If all parameters are omitted, the current extents are returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

  • width – The component’s new width

  • height – The component’s new height

Returns:

the current extents of the component

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

property id: str#

The id of the component (read-only)

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

lock_markers(lock: bool = True, *, delta: float | None = None) None#

Lock (or unlock) markers to a fixed offset from each other.

Parameters:
  • lock – set to False to unlock the marker

  • delta – used to specify lock offset (optional)

Examples:

fft.lock_markers()
fft.lock_markers(delta=1/50)
fft.lock_markers(False)
property main: Enerplot#

A reference to the Application object that returned this Remotable object.

panel(index: int) GraphPanel#

Return the indexed panel

panels() int#

Return the number of panels in a the Frame

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

position(x: int | None = None, y: int | None = None) Tuple[int, int] | None#

Get or set the component’s position.

If the x & y parameters are given, the position is set. If they are omitted, the current position is returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

Returns:

the current location of the component

properties(paramlist: str = '', **kwargs) Dict[str, Any]#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

Relink the channel data to the given datafile

Parameters:

datafile (DataFile) – the datafile to link channel data to.

reset_extents() None#

Reset the graph’s extents

reset_limits() None#

Reset the graph’s limits

set_markers(x: float | None = None, o: float | None = None, *, delta: float | None = None) None#

Set the X and/or O marker positions.

If both x and o are specified, delta cannot be given.

If delta is given, the O-marker is positioned the specified distance after the X-marker, unless the o value is specified in which case the X-marker is positioned the specified distance before the O-marker.

If the markers were hidden, they will automatically be shown.

If the markers are “locked together”, they will remain locked together, but with their relative offset defined by their new positions.

Parameters:
  • x – new x-marker position

  • o – new o-marker position

  • delta – distance between x & o markers

Examples

The following are equivalent, and set the markers 1 cycle apart, assuming a 60Hz waveform:

graph_frame.set_markers(0.1, 0.11666667)
graph_frame.set_markers(0.1, delta=0.01666667)
graph_frame.set_markers(0.1, delta=1/60)
graph_frame.set_markers(delta=1/60, x=0.1)
graph_frame.set_markers(delta=1/60, o=0.11666667)
show_glyphs(show: bool = True) None#

Set the curve glyph visibility.

Parameters:

show – Set to False to turn off the curve glyphs.

show_grid(show: bool = True) None#

Set the grid’s visibility.

Parameters:

show – Set to False to turn off the grid.

show_markers(show: bool = True) None#

Show (or hide) the X/O markers

Parameters:

show – Set to False to turn off the markers.

show_ticks(show: bool = True) None#

Set the tick visibility.

Parameters:

show – Set to False to turn off the tick markers.

show_x_intercept(show: bool = True) None#

Set the X intercept visibility on or off

Parameters:

show – Set to False to turn off the X-intercept visibility.

show_y_intercept(show: bool = True) None#

Set the Y intercept visibility on or off

Parameters:

show – Set to False to turn off the Y-intercept visibility.

size(width: int | None = None, height: int | None = None) Tuple[int, int] | None#

Get or set the component’s size

If the width & height parameters are given, the size is set. If they are omitted, the current size is returned.

Parameters:
  • width – The component’s new width

  • height – The component’s new height

Returns:

the current size of the component

property title: str#

The title of the frame

toggle_curve_glyphs() None#

Toggle curve glyphs on or off

toggle_grid_lines() None#

Toggle grid lines on or off

toggle_markers() None#

Toggle X/O markers

toggle_tick_marks() None#

Toggle tick marks on or off

toggle_x_intercept() None#

Toggle X intercept on or off

toggle_y_intercept() None#

Toggle Y intercept on or off

zoom_extents(x_extents: bool = True, y_extents: bool = True) None#

Reset the graph’s zoom to the X and/or Y extents. By default, both X and Y axis zoom is affected.

Parameters:
  • x_extents – set to False to not affect X-axis

  • y_extents – set to False to not affect Y-axis

zoom_limits(x_limits: bool = True, y_limits: bool = True) None#

Reset the graph’s zoom to the X and/or Y limits. By default, both X and Y axis zoom is affected.

Parameters:
  • x_limits – set to False to not affect X-axis

  • y_limits – set to False to not affect Y-axis

zoom_x_extents() None#

Reset the graph’s zoom for the X-axis to the X extents.

zoom_x_limits() None#

Reset the graph’s zoom for the X-axis to the X limits.

zoom_y_extents() None#

Reset the graph’s zoom for the Y-axis to the Y extents.

zoom_y_limits() None#

Reset the graph’s zoom for the Y-axis to the Y limits.

Plot Frame#

class mhi.enerplot.PlotFrame(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

Plot Frame

A container which holds a X-Y plot graph containing 1 or more curves.

add_curves(*channels: Channel)#

Add one or more channels to the X-Y plot.

For every pair of channels added, one X-Y curve is created.

Parameters:

*channels (Channel) – curves to add to X-Y plot frame

paste_curve() None#

Paste a curve from the clipboard into the graph

polar() PlotFrame#

Switch the plot to Polar mode (magnitude & phase)

rectangular() PlotFrame#

Switch the plot to Rectangular mode (X-Y)

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

copy_as_bitmap() None#

Copy component to clipboard as a bitmap

copy_as_metafile() None#

Copy component to clipboard as a metafile

cut() None#

Remove the component to the clipboard

Delink all channel data from the frame

extents(x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) Tuple[int, int, int, int] | None#

Get or set the component’s position and size

If all parameters are given, the position and size is set. If all parameters are omitted, the current extents are returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

  • width – The component’s new width

  • height – The component’s new height

Returns:

the current extents of the component

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

property id: str#

The id of the component (read-only)

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

property main: Enerplot#

A reference to the Application object that returned this Remotable object.

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

position(x: int | None = None, y: int | None = None) Tuple[int, int] | None#

Get or set the component’s position.

If the x & y parameters are given, the position is set. If they are omitted, the current position is returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

Returns:

the current location of the component

properties(paramlist: str = '', **kwargs) Dict[str, Any]#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

Relink the channel data to the given datafile

Parameters:

datafile (DataFile) – the datafile to link channel data to.

reset_extents() None#

Reset the graph’s extents

reset_limits() None#

Reset the graph’s limits

show_glyphs(show: bool = True) None#

Set the curve glyph visibility.

Parameters:

show – Set to False to turn off the curve glyphs.

show_grid(show: bool = True) None#

Set the grid’s visibility.

Parameters:

show – Set to False to turn off the grid.

show_ticks(show: bool = True) None#

Set the tick visibility.

Parameters:

show – Set to False to turn off the tick markers.

show_x_intercept(show: bool = True) None#

Set the X intercept visibility on or off

Parameters:

show – Set to False to turn off the X-intercept visibility.

show_y_intercept(show: bool = True) None#

Set the Y intercept visibility on or off

Parameters:

show – Set to False to turn off the Y-intercept visibility.

size(width: int | None = None, height: int | None = None) Tuple[int, int] | None#

Get or set the component’s size

If the width & height parameters are given, the size is set. If they are omitted, the current size is returned.

Parameters:
  • width – The component’s new width

  • height – The component’s new height

Returns:

the current size of the component

property title: str#

The title of the frame

toggle_curve_glyphs() None#

Toggle curve glyphs on or off

toggle_grid_lines() None#

Toggle grid lines on or off

toggle_tick_marks() None#

Toggle tick marks on or off

toggle_x_intercept() None#

Toggle X intercept on or off

toggle_y_intercept() None#

Toggle Y intercept on or off

zoom(xmin=None, xmax=None, ymin=None, ymax=None, *, compute_x_grid: bool = True, compute_y_grid: bool = True) None#

Alter the graph’s viewport

zoom_extents(x_extents: bool = True, y_extents: bool = True) None#

Reset the graph’s zoom to the X and/or Y extents. By default, both X and Y axis zoom is affected.

Parameters:
  • x_extents – set to False to not affect X-axis

  • y_extents – set to False to not affect Y-axis

zoom_limits(x_limits: bool = True, y_limits: bool = True) None#

Reset the graph’s zoom to the X and/or Y limits. By default, both X and Y axis zoom is affected.

Parameters:
  • x_limits – set to False to not affect X-axis

  • y_limits – set to False to not affect Y-axis

zoom_x_extents() None#

Reset the graph’s zoom for the X-axis to the X extents.

zoom_x_limits() None#

Reset the graph’s zoom for the X-axis to the X limits.

zoom_y_extents() None#

Reset the graph’s zoom for the Y-axis to the Y extents.

zoom_y_limits() None#

Reset the graph’s zoom for the Y-axis to the Y limits.

FFT Graph Frame#

class mhi.enerplot.FFTFrame(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

FFT Graph Frame

A container which holds an overlay graph, as well as a magnitude and phase graph for automatic harmonic analysis of the curve(s) in the overlay graph.

add_curves(*channels: Channel) None#

Add one or more channels to the FFT Graph

Parameters:

*channels (Channel) – curves to add to graph

paste_curve() None#

Paste a curve from the clipboard into the top graph

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

copy_as_bitmap() None#

Copy component to clipboard as a bitmap

copy_as_metafile() None#

Copy component to clipboard as a metafile

cut() None#

Remove the component to the clipboard

Delink all channel data from the frame

extents(x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) Tuple[int, int, int, int] | None#

Get or set the component’s position and size

If all parameters are given, the position and size is set. If all parameters are omitted, the current extents are returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

  • width – The component’s new width

  • height – The component’s new height

Returns:

the current extents of the component

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

property id: str#

The id of the component (read-only)

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

lock_markers(lock: bool = True, *, delta: float | None = None) None#

Lock (or unlock) markers to a fixed offset from each other.

Parameters:
  • lock – set to False to unlock the marker

  • delta – used to specify lock offset (optional)

Examples:

fft.lock_markers()
fft.lock_markers(delta=1/50)
fft.lock_markers(False)
property main: Enerplot#

A reference to the Application object that returned this Remotable object.

panel(index: int) GraphPanel#

Return the indexed panel

panels() int#

Return the number of panels in a the Frame

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

position(x: int | None = None, y: int | None = None) Tuple[int, int] | None#

Get or set the component’s position.

If the x & y parameters are given, the position is set. If they are omitted, the current position is returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

Returns:

the current location of the component

properties(paramlist: str = '', **kwargs) Dict[str, Any]#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

Relink the channel data to the given datafile

Parameters:

datafile (DataFile) – the datafile to link channel data to.

reset_extents() None#

Reset the graph’s extents

reset_limits() None#

Reset the graph’s limits

set_markers(x: float | None = None, o: float | None = None, *, delta: float | None = None) None#

Set the X and/or O marker positions.

If both x and o are specified, delta cannot be given.

If delta is given, the O-marker is positioned the specified distance after the X-marker, unless the o value is specified in which case the X-marker is positioned the specified distance before the O-marker.

If the markers were hidden, they will automatically be shown.

If the markers are “locked together”, they will remain locked together, but with their relative offset defined by their new positions.

Parameters:
  • x – new x-marker position

  • o – new o-marker position

  • delta – distance between x & o markers

Examples

The following are equivalent, and set the markers 1 cycle apart, assuming a 60Hz waveform:

graph_frame.set_markers(0.1, 0.11666667)
graph_frame.set_markers(0.1, delta=0.01666667)
graph_frame.set_markers(0.1, delta=1/60)
graph_frame.set_markers(delta=1/60, x=0.1)
graph_frame.set_markers(delta=1/60, o=0.11666667)
show_glyphs(show: bool = True) None#

Set the curve glyph visibility.

Parameters:

show – Set to False to turn off the curve glyphs.

show_grid(show: bool = True) None#

Set the grid’s visibility.

Parameters:

show – Set to False to turn off the grid.

show_markers(show: bool = True) None#

Show (or hide) the X/O markers

Parameters:

show – Set to False to turn off the markers.

show_ticks(show: bool = True) None#

Set the tick visibility.

Parameters:

show – Set to False to turn off the tick markers.

show_x_intercept(show: bool = True) None#

Set the X intercept visibility on or off

Parameters:

show – Set to False to turn off the X-intercept visibility.

show_y_intercept(show: bool = True) None#

Set the Y intercept visibility on or off

Parameters:

show – Set to False to turn off the Y-intercept visibility.

size(width: int | None = None, height: int | None = None) Tuple[int, int] | None#

Get or set the component’s size

If the width & height parameters are given, the size is set. If they are omitted, the current size is returned.

Parameters:
  • width – The component’s new width

  • height – The component’s new height

Returns:

the current size of the component

property title: str#

The title of the frame

toggle_curve_glyphs() None#

Toggle curve glyphs on or off

toggle_grid_lines() None#

Toggle grid lines on or off

toggle_markers() None#

Toggle X/O markers

toggle_tick_marks() None#

Toggle tick marks on or off

toggle_x_intercept() None#

Toggle X intercept on or off

toggle_y_intercept() None#

Toggle Y intercept on or off

zoom(xmin=None, xmax=None, ymin=None, ymax=None, *, compute_x_grid: bool = True, compute_y_grid: bool = True) None#

Alter the graph’s viewport

zoom_extents(x_extents: bool = True, y_extents: bool = True) None#

Reset the graph’s zoom to the X and/or Y extents. By default, both X and Y axis zoom is affected.

Parameters:
  • x_extents – set to False to not affect X-axis

  • y_extents – set to False to not affect Y-axis

zoom_limits(x_limits: bool = True, y_limits: bool = True) None#

Reset the graph’s zoom to the X and/or Y limits. By default, both X and Y axis zoom is affected.

Parameters:
  • x_limits – set to False to not affect X-axis

  • y_limits – set to False to not affect Y-axis

zoom_x_extents() None#

Reset the graph’s zoom for the X-axis to the X extents.

zoom_x_limits() None#

Reset the graph’s zoom for the X-axis to the X limits.

zoom_y_extents() None#

Reset the graph’s zoom for the Y-axis to the Y extents.

zoom_y_limits() None#

Reset the graph’s zoom for the Y-axis to the Y limits.

Graph Panel#

class mhi.enerplot.GraphPanel(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

Graph Panel

add_curves(*channels: Channel) None#

Add one or more channels to a graph

Parameters:

*channels (Channel) – curves to add to graph

paste_curve() None#

Paste a curve from the clipboard into the graph

remove(*curves: Curve)#

Remove curves from the Graph Panel

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

copy_as_bitmap() None#

Copy component to clipboard as a bitmap

copy_as_metafile() None#

Copy component to clipboard as a metafile

cut() None#

Remove the component to the clipboard

extents(x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) Tuple[int, int, int, int] | None#

Get or set the component’s position and size

If all parameters are given, the position and size is set. If all parameters are omitted, the current extents are returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

  • width – The component’s new width

  • height – The component’s new height

Returns:

the current extents of the component

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

property id: str#

The id of the component (read-only)

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

property main: Enerplot#

A reference to the Application object that returned this Remotable object.

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

position(x: int | None = None, y: int | None = None) Tuple[int, int] | None#

Get or set the component’s position.

If the x & y parameters are given, the position is set. If they are omitted, the current position is returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

Returns:

the current location of the component

properties(paramlist: str = '', **kwargs) Dict[str, Any]#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

reset_extents() None#

Reset the graph’s extents

reset_limits() None#

Reset the graph’s limits

show_glyphs(show: bool = True) None#

Set the curve glyph visibility.

Parameters:

show – Set to False to turn off the curve glyphs.

show_grid(show: bool = True) None#

Set the grid’s visibility.

Parameters:

show – Set to False to turn off the grid.

show_ticks(show: bool = True) None#

Set the tick visibility.

Parameters:

show – Set to False to turn off the tick markers.

show_x_intercept(show: bool = True) None#

Set the X intercept visibility on or off

Parameters:

show – Set to False to turn off the X-intercept visibility.

show_y_intercept(show: bool = True) None#

Set the Y intercept visibility on or off

Parameters:

show – Set to False to turn off the Y-intercept visibility.

size(width: int | None = None, height: int | None = None) Tuple[int, int] | None#

Get or set the component’s size

If the width & height parameters are given, the size is set. If they are omitted, the current size is returned.

Parameters:
  • width – The component’s new width

  • height – The component’s new height

Returns:

the current size of the component

toggle_curve_glyphs() None#

Toggle curve glyphs on or off

toggle_grid_lines() None#

Toggle grid lines on or off

toggle_tick_marks() None#

Toggle tick marks on or off

toggle_x_intercept() None#

Toggle X intercept on or off

toggle_y_intercept() None#

Toggle Y intercept on or off

zoom(xmin=None, xmax=None, ymin=None, ymax=None, *, compute_x_grid: bool = True, compute_y_grid: bool = True) None#

Alter the graph’s viewport

zoom_extents(x_extents: bool = True, y_extents: bool = True) None#

Reset the graph’s zoom to the X and/or Y extents. By default, both X and Y axis zoom is affected.

Parameters:
  • x_extents – set to False to not affect X-axis

  • y_extents – set to False to not affect Y-axis

zoom_limits(x_limits: bool = True, y_limits: bool = True) None#

Reset the graph’s zoom to the X and/or Y limits. By default, both X and Y axis zoom is affected.

Parameters:
  • x_limits – set to False to not affect X-axis

  • y_limits – set to False to not affect Y-axis

zoom_x_extents() None#

Reset the graph’s zoom for the X-axis to the X extents.

zoom_x_limits() None#

Reset the graph’s zoom for the X-axis to the X limits.

zoom_y_extents() None#

Reset the graph’s zoom for the Y-axis to the Y extents.

zoom_y_limits() None#

Reset the graph’s zoom for the Y-axis to the Y limits.

Curves#

class mhi.enerplot.Curve(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

Graph Curve

channel() Channel#

Retrieve the channel associated with a curve

property data: array#

Data (y-axis values) of the trace

extents() Tuple[Tuple[float, float], Tuple[float, float]]#

The domain and range of this Curve

Returns:

domain (minimum x, maximum x) and range (minimum y, maximum y)

generate_new_record() None#

Your description here

properties(**kwargs)#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

copy_as_bitmap() None#

Copy component to clipboard as a bitmap

copy_as_metafile() None#

Copy component to clipboard as a metafile

cut() None#

Remove the component to the clipboard

decreasing() bool#

Test if a trace contains strictly decreasing values.

Returns:

True if every value is smaller than the previous one.

static div(a, b, inf=inf, nan=nan) float#

Handle x/0 and 0/0 without raising DivisionByZeroException

property domain#

Domain (x-axis values, such as time) of the trace

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

property id: str#

The id of the component (read-only)

increasing() bool#

Test if a trace contains strictly increasing values.

A strictly increasing trace is suitable to use as the domain of a dataset.

Returns:

True if every value is larger than the previous one.

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

property main: Enerplot#

A reference to the Application object that returned this Remotable object.

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

position(x: int | None = None, y: int | None = None) Tuple[int, int] | None#

Get or set the component’s position.

If the x & y parameters are given, the position is set. If they are omitted, the current position is returned.

Parameters:
  • x – The component’s new x location on the sheet

  • y – The component’s new y location on the sheet

Returns:

the current location of the component

range(keyword: str)#

Return the allowable values for the given property name

property read_only#

Whether or not the data is immutable

size(width: int | None = None, height: int | None = None) Tuple[int, int] | None#

Get or set the component’s size

If the width & height parameters are given, the size is set. If they are omitted, the current size is returned.

Parameters:
  • width – The component’s new width

  • height – The component’s new height

Returns:

the current size of the component