chaco.overlays.plot_label module

Defines the PlotLabel class.

class chaco.overlays.plot_label.PlotLabel(text='', *args, **kw)

Bases: chaco.abstract_overlay.AbstractOverlay

A label used by plots.

This class wraps a simple Label instance, and delegates some traits to it.

angle = DelegatesTo("_label", "rotate_angle")

The angle of rotation of the label.

color = DelegatesTo("_label")

The color of the label text.


Tells this component to do layout.

Overrides PlotComponent.

draw_layer = "plot"

By default, this acts like a component and will render on the main “plot” layer unless its component attribute gets set.

font = LabelDelegate

The font for the label text.


Returns the label’s preferred size.

Overrides PlotComponent.

hjustify = Enum("center", "left", "right")

Horizontal justification used if the label has more horizontal space than it needs.

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

Draws this label overlaid on another component.

Overrides AbstractOverlay.

overlay_position = Union(Str("outside top"), None)

The position of this label relative to the object it is overlaying. Can be “top”, “left”, “right”, “bottom”, and optionally can be preceeded by the words “inside” or “outside”, separated by a space. If “inside” and “outside” are not provided, then defaults to “outside”. .. rubric:: Examples

inside top outside right

resizable = "h"

The label has a fixed height and can be resized horizontally. (Overrides PlotComponent.)

text = LabelDelegate

The text of the label.

vjustify = Enum("center", "bottom", "top")

Vertical justification used if the label has more vertical space than it needs.