chaco.plots.multi_line_plot module

Defines the MultiLinePlot class.

class chaco.plots.multi_line_plot.MultiLinePlot(**kwtraits)

Bases: chaco.base_xy_plot.BaseXYPlot

A plot consisting of multiple lines.

The data to be plotted must come from a two-dimensional array with shape M by N stored in a MultiArrayDataSource object. M is the number of lines to be plotted, and N is the number of points in each line.

Parameters
  • index (instance of an ArrayDataSource) – These are the ‘x’ or abscissa coordinates.

  • yindex (instance of ArrayDataSource) – These are the ‘y’ coordinates.

  • value (instance of a MultiArrayDataSource) – Note that the scale, offset and normalized_amplitude attributes of the MultiLinePlot control the projection of the traces into the (x,y) plot. In simplest case, scale=1 and offset=0, and normalized_amplitude controls the scaling of the traces relative to their base y value.

  • global_min (float) – The minimum and maximum values of the data in value. For large arrays, computing these could take excessive time, so they must be provided when an instance is created.

  • global_max (float) – The minimum and maximum values of the data in value. For large arrays, computing these could take excessive time, so they must be provided when an instance is created.

  • normalized_amplitude (Float) –

  • color (ColorTrait) –

  • color_func (Callable or None) – If not None, this Callable overrides color. The argument to color_func will be the integer index of the trace to be rendered. color_func must return an RGBA 4-tuple. Default: None

  • orientation (str) – Must be ‘v’ or ‘h’ (for ‘vertical’ or ‘horizontal’, respectively). This is the orientation of the index axis (i.e. the ‘x’ axis). Default: ‘h’

  • fast_clip (bool) – If True, traces whose base ‘y’ coordinate is outside the value axis range are not plotted, even if some of the data in the curve extends into the plot region. Default: False

  • line_width (float) – Width of the plotted lines.

  • line_style – The style of the trace lines in the plot.

  • following are from the original LinePlot code (The) –

  • are untested (and) –

  • selected_color

  • selected_line_style

color = black_color_trait(requires_redraw=True)

The color of the lines.

color_func = Optional(Callable)

A function that returns the color of lines. Overrides color if not None.

get_screen_points()

Returns the currently visible screen-space points.

Intended for use with overlays.

global_max = Float

Maximum value in the value data source. This must be provided in the call to the constructor.

global_min = Float

Minimum value in the value data source. This must be provided in the call to the constructor.

line_style = LineStyle(requires_redraw=True)

The line dash style.

line_width = Float(1.0, requires_redraw=True)

The thickness of the line.

metadata_name = Str("selections")

The name of the key in self.metadata that holds the selection mask

normalized_amplitude = Float(-0.5)

Normalized amplitude is the value exposed to the user.

scale = Float(1.0)

scale and offset provide a more general transformation, but are currently untested.

selected_color = ColorTrait("lightyellow")

The color to use to highlight the line when selected.

selected_line_style = LineStyle("solid")

The style of the selected line.

trait_view(obj)

Create a minimalist View, with just the amplitude and color attributes.