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 specializedupdate
function that generatesLine
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. Ifauto
, the limits automatically adjusts every time the data changes. Ifgrow
, 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, specifyscale={'tof': 'log'}
if you want log-scale for thetof
dimension.errorbars (
bool
, default:True
) – Hide errorbars ifFalse
.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 ifTrue
.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. IfNone
, 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 ifTrue
. Iflegend
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 coordinatematplotlib.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.