plopp.graphics.LineView#

class plopp.graphics.LineView(*nodes, norm='linear', vmin=None, vmax=None, autoscale='auto', scale=None, errorbars=True, mask_color='black', aspect='auto', grid=False, title=None, figsize=None, format=None, legend=True, **kwargs)[source]#

View that makes a visual representation of one-dimensional data. It has a Canvas and a specialized update function that generates Line artists.

Parameters:
  • *nodes – The nodes that are attached to the view.

  • norm (Literal['linear', 'log'], default: 'linear') – Control the scaling on the vertical axis.

  • vmin (Union[Variable, int, float, None], default: None) – Lower bound for the vertical axis. If a number (without a unit) is supplied, it is assumed that the unit is the same as the current vertical axis unit.

  • vmax (Union[Variable, int, float, None], default: None) – Upper bound for the vertical axis. If a number (without a unit) is supplied, it is assumed that the unit is the same as the current vertical axis unit.

  • autoscale (Literal['auto', 'grow'], default: 'auto') – The behavior of the axis limits. If auto, the limits automatically adjusts every time the data changes. If grow, the limits are allowed to grow with time but they do not shrink.

  • scale (Optional[Dict[str, str]], default: None) – Control the scaling of the horizontal axis. For example, specify scale={'tof': 'log'} if you want log-scale for the tof dimension.

  • errorbars (bool, default: True) – Hide errorbars if False.

  • mask_color (str, default: 'black') – The color of the masks.

  • aspect (Literal['auto', 'equal'], default: 'auto') – Aspect ratio for the axes.

  • grid (bool, default: False) – Show grid if True.

  • title (Optional[str], default: None) – The figure title.

  • figsize (Optional[Tuple[float, float]], default: None) – The width and height of the figure, in inches.

  • ax – If supplied, use these axes to create the figure. If none are supplied, the canvas will create its own axes.

  • format (Optional[Literal['svg', 'png']], default: None) – Format of the figure displayed in the Jupyter notebook. If None, a SVG is created as long as the number of markers in the figure is not too large. If too many markers are drawn, a PNG image is created instead.

  • legend (Union[bool, Tuple[float, float]], default: True) – Show legend if True. If legend is a tuple, it should contain the (x, y) coordinates of the legend’s anchor point in axes coordinates.

  • **kwargs

    All other kwargs are forwarded to Matplotlib:

    • matplotlib.pyplot.plot for 1d data with a non bin-edge coordinate

    • matplotlib.pyplot.step for 1d data with a bin-edge coordinate

__init__(*nodes, norm='linear', vmin=None, vmax=None, autoscale='auto', scale=None, errorbars=True, mask_color='black', aspect='auto', grid=False, title=None, figsize=None, format=None, legend=True, **kwargs)[source]#

Methods

__init__(*nodes[, norm, vmin, vmax, ...])

make_artist(new_values)

notify_view(message)

When a notification is received, request data from the corresponding parent node and update the relevant artist.

render()

At the end of figure creation, this function is called to request data from all parent nodes and draw the figure.

update(*args, **kwargs)

Update the view with new data by either supplying a dictionary of new data or by keyword arguments.

Attributes

id

The unique id of the view.