chaco.base_2d_plot module

Defines the base class for 2-D plots.

class chaco.base_2d_plot.Base2DPlot(**kwargs)

Bases: chaco.abstract_plot_renderer.AbstractPlotRenderer

Base class for 2-D plots.

alpha = Range(0.0, 1.0, 1.0)

Overall alpha value of the image. Ranges from 0.0 for transparent to 1.0 for full intensity.

draw_layer = "image"

Overrides PlotComponent; 2-D plots draw on the ‘image’ layer, underneath all decorations and annotations, and above only the background fill color.

index = Instance(GridDataSource)

The data source to use for the index coordinate.

index_data_changed = Event

Event fired when the index data changes. Subclasses can listen for this event and take appropriate steps (except for requesting a redraw, which is done in this class).

index_mapper = Instance(GridMapper)

Screen mapper for 2-D structured (gridded) index data.

index_mapper_changed = Event

Event fired when the index mapper changes. Subclasses can listen for this event and take appropriate steps (except for requesting a redraw, which is done in this class).

index_range = Property

Convenience property for accessing the data range of the mapper.

labels = Property

Convenience property for accessing the plots labels.

map_data(screen_pts)

Maps a screen space point into the “index” space of the plot.

Implements the AbstractPlotRenderer interface.

map_index(screen_pt, threshold=2.0, outside_returns_none=True, index_only=False)

Maps a screen space point to an index into the plot’s index arrays.

Implements the AbstractPlotRenderer interface. The index_only parameter is ignored because the index is intrinsically 2-D.

map_screen(data_pts)

Maps an array of data points into screen space and returns it as an array.

Implements the AbstractPlotRenderer interface.

orientation = Enum("h", "v")

The direction that the first array returned by self.index.get_data() maps to.

  • ‘h’: index maps to x-direction

  • ‘v’: index maps to y-direction

value = Instance(ImageData)

The data source to use as value points.

value_data_changed = Event

Event fired when the value data changes. Subclasses can listen for this event and take appropriate steps (except for requesting a redraw, which is done in this class).

x_mapper = Property

Convenience property for accessing the x-direction mappers regardless of orientation. This provides compatibility with a number of tools.

y_mapper = Property

Convenience property for accessing the y-direction mappers regardless of orientation. This provides compatibility with a number of tools.