chaco.data_range_2d module

Defines the DataRange2D class.

class chaco.data_range_2d.DataRange2D(*args, **kwargs)

Bases: chaco.base_data_range.BaseDataRange

A range on (2-D) image data.

In a mathematically general sense, a 2-D range is an arbitrary region in the plane. Arbitrary regions are difficult to implement well, so this class supports only rectangular regions for now.

bound_data(data)

Not implemented for this class.

clip_data(data)

Returns a list of data values that are within the range.

Implements AbstractDataRange.

epsilon = Tuple(CFloat(1.0e-4), CFloat(1.0e-4))

The minimum percentage difference between low and high for each dimension. That is, (high-low) >= epsilon * low.

high = Property  # (2,) array of upper-right x,y

The actual value of the upper bound of this range. To set it, use high_setting.

high_setting = Property

Property for the upper bound of this range (overrides AbstractDataRange).

low = Property  # (2,) array of lower-left x,y

The actual value of the lower bound of this range. To set it, use low_setting.

low_setting = Property

Property for the lower bound of this range (overrides AbstractDataRange).

mask_data(data)

Returns a mask array, indicating whether values in the given array are inside the range.

Implements AbstractDataRange.

refresh(event=None)

If any of the bounds is ‘auto’, this method refreshes the actual low and high values from the set of the view filters’ data sources.

reset()

Resets the bounds of this range.

set_bounds(low, high)

Sets all the bounds of the range simultaneously.

Implements AbstractDataRange.

Parameters
  • low ((x,y)) – Lower-left corner of the range.

  • high ((x,y)) – Upper right corner of the range.

tight_bounds = Tuple(Bool(True), Bool(True))

Do “auto” bounds imply an exact fit to the data? (One Boolean per dimension) If False, the bounds pad a little bit of margin on either side.

x_range = Property

Property for the range in the x-dimension.

y_range = Property

Property for the range in the y-dimension.