chaco.grid_data_source module

Defines the GridDataSource class.

class chaco.grid_data_source.GridDataSource(xdata=array([], dtype=float64), ydata=array([], dtype=float64), sort_order=('none', 'none'), **kwargs)

Bases: chaco.abstract_data_source.AbstractDataSource

Implements a structured gridded 2-D data source (suitable as an index for an image, for example).

get_bounds()

Implements AbstractDataSource. Returns two 2-D points, min and max, that represent the bounding corners of a rectangle enclosing the data set. Note that these values are not view-dependent, but represent intrinsic properties of the DataSource.

If data axis is the empty set, then the min and max valuess are 0.0.

get_data()

Implements AbstractDataSource. Because this class uses structured (gridded) data, this method returns the pair of data axes, instead of, for example, a full mesh-grid. This behavious differs from other data sources.

index_dimension = Constant("image")

The dimensionality of the indices into this data source (overrides AbstractDataSource).

set_data(xdata, ydata, sort_order=None)

Sets the data, and optionally the sort order, for this data source.

Parameters
  • xdata (array) – The data to use.

  • ydata (array) – The data to use.

  • sort_order (SortOrderTrait) – The sort order of the data

sort_order = Tuple(SortOrderTrait, SortOrderTrait)

The sort order of the data (overrides AbstractDataSource). There is no overall sort order on 2-D data, but for gridded 2-D data, each axis can have a sort order.

value_dimension = Constant("scalar")

The dimensionality of the value at each index point (overrides AbstractDataSource).