Line module

class lys.widgets.canvas.interface.Line.LineData(canvas, wave, axis)[source]

Bases: WaveData

Interface to access line data in the canvas.

Instance of LineData is automatically generated by display or append methods.

Example:

from lys import display
g = display([1,2,3])
g.getLines()[0].setColor('#ff0000')
getCapSize()[source]

Get the cap size of the errorbar.

Returns

The cap size.

Return type

float

getColor()[source]

Get color of the line.

Returns

color string such as #ff0000

Return type

str

getErrorbar(direction='y')[source]

Set the errorbar.

Parameters

direction ('x' or 'y') – The direction of the errorbar

Returns

The errorbar

Return type

list

getLegendLabel()[source]

Get the label of the legend.

Returns

The label.

Return type

str

getLegendVisible()[source]

Get the visibility of the legend.

Returns

The visibility.

Return type

bool

getMarker()[source]

Get the marker shape.

Returns

String that indicate the marker shape. List of style strings can be seen from matplotlib.lines.Line2D.markers.values().

Return type

str

getMarkerFilling()[source]

Get the filling of the marker.

Returns

Style string.

Return type

str

getMarkerSize()[source]

Get the size of the marker.

Returns

The size of the marker.

Return type

float

getMarkerThick()[source]

Get the thickness of the marker edge.

Returns

The thickness of the marker edge.

Return type

float

getStyle()[source]

Get the style of the line.

Returns

Style string.

Return type

str

getWidth()[source]

Get the width of the line.

Returns

The width of the line.

Return type

float

setCapSize(capsize)[source]

Set the cap size of the errorbar.

Parameters

capsize (float) – The cap size.

setColor(color)[source]

Set color of the line.

Parameters

color (str) – rgb color string such as #ff0000.

setErrorbar(error, direction='y')[source]

Set the errorbar.

If the error is float, the constant errorbar is set.

If the error is str, the errorbar is loaded from wave.note[error].

If the error is an array, the array is used as the errorbar.

Parameters
  • error (float or str or array) – The error.

  • direction ('x' or 'y') – The direction of the errorbar

setLegendLabel(label)[source]

Set the label of the legend.

Parameters

label (str) – The label.

setLegendVisible(visible)[source]

Set the visibility of the legend.

Parameters

visible (bool) – The visibility.

setMarker(marker)[source]

Set the marker shape.

Parameters

marker (str) – String that indicate the marker shape. List of style strings can be seen from matplotlib.lines.Line2D.markers.values().

setMarkerFilling(type)[source]

Set the filling of the marker.

Parameters

type ('full', 'left', 'ritght', 'top', 'bottom', or 'none') – Style string.

setMarkerSize(size)[source]

Set the size of the marker.

Parameters

size (float) – The size of the marker.

setMarkerThick(thick)[source]

Set the thickness of the marker edge.

Parameters

thick (float) – The thickness of the marker edge.

setStyle(style)[source]

Set the style of the line.

Parameters

style ('solid', 'dashed', 'dashdot', 'dotted', 'None') – Style string.

setWidth(width)[source]

Set the width of the line.

Parameters

width (float) – The width of the line.