chaco.svg_graphics_context module

Defines the PlotGraphicsContext class.

class chaco.svg_graphics_context.SVGGraphicsContext(size_or_ary, dpi=72.0, *args, **kw)

Bases: kiva.svg.GraphicsContext

A Kiva graphics context, which facilitates rendering plots and plot components into an offscreen or memory buffer.

Its only real difference from a Kiva graphics context is that this class correctly offsets the coordinate frame by (0.5, 0.5) and increases the actual size of the image by 1 pixel in each dimension. When rendering into on-screen windows through Enable, this transformation step is handled by Enable.

clip_to_rect(x, y, width, height)

Offsets the coordinate frame by (0.5, 0.5) and increases the actual size of the image by 1 pixel in each dimension.

Overrides Kiva GraphicsContext.

render_component(component, container_coords=False)

Renders the given component.

Parameters
  • component (Component) – The component to be rendered.

  • container_coords (Boolean) – Whether to use coordinates of the component’s container

  • Description

  • -----------

  • container_coords is False (If) –

  • the (0 (then) –

  • coordinate of this (0)) –

  • context corresponds to the lower-left corner of the (graphics) –

  • outer_bounds. If container_coords is True (component's) –

  • the (then) –

  • draws the component as it appears inside its container (method) –

  • i.e.

  • it

  • (0 (treats) –

  • of the graphics context as the lower-left corner of the (0)) –

  • outer bounds. (container's) –