Defines the LineInspector tool class.

class, **traits)

Bases: enable.base_tool.BaseTool

A simple tool to draw a line parallel to the index or the value axis of an X-Y plot.

This tool supports only plots with a 1-D index.

axis = Enum("index", "value", "index_x", "index_y")

The axis that this tool is parallel to.

color = ColorTrait("black")

Color of the line.

do_layout(*args, **kw)
draw(gc, view_bounds=None)

Draws this tool on a graphics context.

Overrides BaseTool.

draw_mode = "overlay"

This tool is drawn as an overlay (overrides BaseTool).

inspect_mode = Enum("space", "indexed")

The possible inspection modes of the tool.


The tool maps from screen space into the data space of the plot.


The tool maps from screen space to an index into the plot’s index array.

is_interactive = Bool(True)

Respond to user mouse events?

is_listener = Bool(False)

Does the tool respond to updates in the metadata on the data source and update its own position?

line_style = LineStyle("solid")

Dash style of the line.

line_width = Float(1.0)

Width in pixels of the line.

metadata_name = Str("selections")

The name of the metadata field to listen or write to.


Handles the mouse leaving the plot.


Handles the mouse being moved.

overlay(component, gc, view_bounds=None, mode='normal')

Draws this component overlaid on a graphics context.

visible = True

This tool is visible (overrides BaseTool).

write_metadata = Bool(False)

If interactive, does the line inspector write the current data space point to the appropriate data source’s metadata?